1 #define LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ LDKCVec_TransactionOutputsZ
2 #define CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free CVec_TransactionOutputsZ_free
4 // On OSX jlong (ie long long) is not equivalent to int64_t, so we override here
6 #include "org_ldk_impl_bindings.h"
12 #define LIKELY(v) __builtin_expect(!!(v), 1)
13 #define UNLIKELY(v) __builtin_expect(!!(v), 0)
15 #define DEBUG_PRINT(...) fprintf(stderr, __VA_ARGS__)
16 #define MALLOC(a, _) malloc(a)
17 #define FREE(p) if ((uint64_t)(p) > 4096) { free(p); }
18 #define CHECK_ACCESS(p)
19 #define CHECK_INNER_FIELD_ACCESS_OR_NULL(v)
20 #define DO_ASSERT(a) (void)(a)
23 static jmethodID ordinal_meth = NULL;
24 JNIEXPORT void Java_org_ldk_impl_bindings_init(JNIEnv * env, jclass _b, jclass enum_class) {
25 ordinal_meth = (*env)->GetMethodID(env, enum_class, "ordinal", "()I");
26 CHECK(ordinal_meth != NULL);
29 // We assume that CVec_u8Z and u8slice are the same size and layout (and thus pointers to the two can be mixed)
30 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKu8slice), "Vec<u8> and [u8] need to have been mapped identically");
31 _Static_assert(offsetof(LDKCVec_u8Z, data) == offsetof(LDKu8slice, data), "Vec<u8> and [u8] need to have been mapped identically");
32 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), "Vec<u8> and [u8] need to have been mapped identically");
34 _Static_assert(sizeof(jlong) == sizeof(int64_t), "We assume that j-types are the same as C types");
35 _Static_assert(sizeof(jbyte) == sizeof(char), "We assume that j-types are the same as C types");
36 _Static_assert(sizeof(void*) <= 8, "Pointers must fit into 64 bits");
38 typedef jlongArray int64_tArray;
39 typedef jbyteArray int8_tArray;
40 typedef jshortArray int16_tArray;
42 static inline jstring str_ref_to_java(JNIEnv *env, const char* chars, size_t len) {
43 // Sadly we need to create a temporary because Java can't accept a char* without a 0-terminator
44 char* conv_buf = MALLOC(len + 1, "str conv buf");
45 memcpy(conv_buf, chars, len);
47 jstring ret = (*env)->NewStringUTF(env, conv_buf);
51 static inline LDKStr java_to_owned_str(JNIEnv *env, jstring str) {
52 uint64_t str_len = (*env)->GetStringUTFLength(env, str);
53 char* newchars = MALLOC(str_len + 1, "String chars");
54 const char* jchars = (*env)->GetStringUTFChars(env, str, NULL);
55 memcpy(newchars, jchars, str_len);
56 newchars[str_len] = 0;
57 (*env)->ReleaseStringUTFChars(env, str, jchars);
61 .chars_is_owned = true
66 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1ldk_1c_1bindings_1version(JNIEnv *env, jclass _c) {
67 return str_ref_to_java(env, check_get_ldk_bindings_version(), strlen(check_get_ldk_bindings_version()));
69 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1ldk_1version(JNIEnv *env, jclass _c) {
70 return str_ref_to_java(env, check_get_ldk_version(), strlen(check_get_ldk_version()));
73 static jclass arr_of_B_clz = NULL;
74 static jclass String_clz = NULL;
75 JNIEXPORT void Java_org_ldk_impl_bindings_init_1class_1cache(JNIEnv * env, jclass clz) {
76 arr_of_B_clz = (*env)->FindClass(env, "[B");
77 CHECK(arr_of_B_clz != NULL);
78 arr_of_B_clz = (*env)->NewGlobalRef(env, arr_of_B_clz);
79 String_clz = (*env)->FindClass(env, "java/lang/String");
80 CHECK(String_clz != NULL);
81 String_clz = (*env)->NewGlobalRef(env, String_clz);
83 static inline struct LDKThirtyTwoBytes ThirtyTwoBytes_clone(const struct LDKThirtyTwoBytes *orig) { struct LDKThirtyTwoBytes ret; memcpy(ret.data, orig->data, 32); return ret; }
85 static inline void* untag_ptr(uint64_t ptr) {
86 if (ptr < 4096) return (void*)ptr;
87 if (sizeof(void*) == 4) {
88 // For 32-bit systems, store pointers as 64-bit ints and use the 31st bit
89 return (void*)(uintptr_t)ptr;
91 // For 64-bit systems, assume the top byte is used for tagging, then
92 // use bit 9 ^ bit 10.
93 uint64_t tenth_bit = (((uintptr_t)ptr) & (1ULL << 54)) >> 54;
94 uintptr_t p = (ptr & ~(1ULL << 55)) | (tenth_bit << 55);
95 #ifdef LDK_DEBUG_BUILD
96 // On debug builds we also use the 11th bit as a debug flag
97 uintptr_t eleventh_bit = (((uintptr_t)ptr) & (1ULL << 53)) >> 53;
98 CHECK(tenth_bit != eleventh_bit);
104 static inline bool ptr_is_owned(uint64_t ptr) {
105 if(ptr < 4096) return true;
106 if (sizeof(void*) == 4) {
107 return ptr & (1ULL << 32);
109 uintptr_t ninth_bit = (((uintptr_t)ptr) & (1ULL << 55)) >> 55;
110 uintptr_t tenth_bit = (((uintptr_t)ptr) & (1ULL << 54)) >> 54;
111 #ifdef LDK_DEBUG_BUILD
112 // On debug builds we also use the 11th bit as a debug flag
113 uintptr_t eleventh_bit = (((uintptr_t)ptr) & (1ULL << 53)) >> 53;
114 CHECK(tenth_bit != eleventh_bit);
116 return (ninth_bit ^ tenth_bit) ? true : false;
119 static inline uint64_t tag_ptr(const void* ptr, bool is_owned) {
120 if ((uintptr_t)ptr < 4096) return (uint64_t)ptr;
121 if (sizeof(void*) == 4) {
122 return (((uint64_t)ptr) | ((is_owned ? 1ULL : 0) << 32));
124 CHECK(sizeof(uintptr_t) == 8);
125 uintptr_t tenth_bit = (((uintptr_t)ptr) & (1ULL << 54)) >> 54;
126 uintptr_t t = (((uintptr_t)ptr) | (((is_owned ? 1ULL : 0ULL) ^ tenth_bit) << 55));
127 #ifdef LDK_DEBUG_BUILD
128 uintptr_t ninth_bit = (((uintptr_t)ptr) & (1ULL << 55)) >> 55;
129 uintptr_t eleventh_bit = (((uintptr_t)ptr) & (1ULL << 53)) >> 53;
130 CHECK(ninth_bit == tenth_bit);
131 CHECK(ninth_bit == eleventh_bit);
134 CHECK(ptr_is_owned(t) == is_owned);
135 CHECK(untag_ptr(t) == ptr);
140 static inline LDKCOption_NoneZ LDKCOption_NoneZ_from_java(JNIEnv *env, jclass clz) {
141 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
142 if (UNLIKELY((*env)->ExceptionCheck(env))) {
143 (*env)->ExceptionDescribe(env);
144 (*env)->FatalError(env, "A call to COption_NoneZ.ordinal() from rust threw an exception.");
147 case 0: return LDKCOption_NoneZ_Some;
148 case 1: return LDKCOption_NoneZ_None;
150 (*env)->FatalError(env, "A call to COption_NoneZ.ordinal() from rust returned an invalid value.");
151 abort(); // Unreachable, but will let the compiler know we don't return here
153 static jclass COption_NoneZ_class = NULL;
154 static jfieldID COption_NoneZ_LDKCOption_NoneZ_Some = NULL;
155 static jfieldID COption_NoneZ_LDKCOption_NoneZ_None = NULL;
156 JNIEXPORT void JNICALL Java_org_ldk_enums_COption_1NoneZ_init (JNIEnv *env, jclass clz) {
157 COption_NoneZ_class = (*env)->NewGlobalRef(env, clz);
158 CHECK(COption_NoneZ_class != NULL);
159 COption_NoneZ_LDKCOption_NoneZ_Some = (*env)->GetStaticFieldID(env, COption_NoneZ_class, "LDKCOption_NoneZ_Some", "Lorg/ldk/enums/COption_NoneZ;");
160 CHECK(COption_NoneZ_LDKCOption_NoneZ_Some != NULL);
161 COption_NoneZ_LDKCOption_NoneZ_None = (*env)->GetStaticFieldID(env, COption_NoneZ_class, "LDKCOption_NoneZ_None", "Lorg/ldk/enums/COption_NoneZ;");
162 CHECK(COption_NoneZ_LDKCOption_NoneZ_None != NULL);
164 static inline jclass LDKCOption_NoneZ_to_java(JNIEnv *env, LDKCOption_NoneZ val) {
166 case LDKCOption_NoneZ_Some:
167 return (*env)->GetStaticObjectField(env, COption_NoneZ_class, COption_NoneZ_LDKCOption_NoneZ_Some);
168 case LDKCOption_NoneZ_None:
169 return (*env)->GetStaticObjectField(env, COption_NoneZ_class, COption_NoneZ_LDKCOption_NoneZ_None);
174 static inline LDKChannelMonitorUpdateStatus LDKChannelMonitorUpdateStatus_from_java(JNIEnv *env, jclass clz) {
175 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
176 if (UNLIKELY((*env)->ExceptionCheck(env))) {
177 (*env)->ExceptionDescribe(env);
178 (*env)->FatalError(env, "A call to ChannelMonitorUpdateStatus.ordinal() from rust threw an exception.");
181 case 0: return LDKChannelMonitorUpdateStatus_Completed;
182 case 1: return LDKChannelMonitorUpdateStatus_InProgress;
183 case 2: return LDKChannelMonitorUpdateStatus_PermanentFailure;
185 (*env)->FatalError(env, "A call to ChannelMonitorUpdateStatus.ordinal() from rust returned an invalid value.");
186 abort(); // Unreachable, but will let the compiler know we don't return here
188 static jclass ChannelMonitorUpdateStatus_class = NULL;
189 static jfieldID ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed = NULL;
190 static jfieldID ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress = NULL;
191 static jfieldID ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure = NULL;
192 JNIEXPORT void JNICALL Java_org_ldk_enums_ChannelMonitorUpdateStatus_init (JNIEnv *env, jclass clz) {
193 ChannelMonitorUpdateStatus_class = (*env)->NewGlobalRef(env, clz);
194 CHECK(ChannelMonitorUpdateStatus_class != NULL);
195 ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateStatus_class, "LDKChannelMonitorUpdateStatus_Completed", "Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
196 CHECK(ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed != NULL);
197 ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateStatus_class, "LDKChannelMonitorUpdateStatus_InProgress", "Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
198 CHECK(ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress != NULL);
199 ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateStatus_class, "LDKChannelMonitorUpdateStatus_PermanentFailure", "Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
200 CHECK(ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure != NULL);
202 static inline jclass LDKChannelMonitorUpdateStatus_to_java(JNIEnv *env, LDKChannelMonitorUpdateStatus val) {
204 case LDKChannelMonitorUpdateStatus_Completed:
205 return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateStatus_class, ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed);
206 case LDKChannelMonitorUpdateStatus_InProgress:
207 return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateStatus_class, ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress);
208 case LDKChannelMonitorUpdateStatus_PermanentFailure:
209 return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateStatus_class, ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure);
214 static inline LDKConfirmationTarget LDKConfirmationTarget_from_java(JNIEnv *env, jclass clz) {
215 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
216 if (UNLIKELY((*env)->ExceptionCheck(env))) {
217 (*env)->ExceptionDescribe(env);
218 (*env)->FatalError(env, "A call to ConfirmationTarget.ordinal() from rust threw an exception.");
221 case 0: return LDKConfirmationTarget_Background;
222 case 1: return LDKConfirmationTarget_Normal;
223 case 2: return LDKConfirmationTarget_HighPriority;
225 (*env)->FatalError(env, "A call to ConfirmationTarget.ordinal() from rust returned an invalid value.");
226 abort(); // Unreachable, but will let the compiler know we don't return here
228 static jclass ConfirmationTarget_class = NULL;
229 static jfieldID ConfirmationTarget_LDKConfirmationTarget_Background = NULL;
230 static jfieldID ConfirmationTarget_LDKConfirmationTarget_Normal = NULL;
231 static jfieldID ConfirmationTarget_LDKConfirmationTarget_HighPriority = NULL;
232 JNIEXPORT void JNICALL Java_org_ldk_enums_ConfirmationTarget_init (JNIEnv *env, jclass clz) {
233 ConfirmationTarget_class = (*env)->NewGlobalRef(env, clz);
234 CHECK(ConfirmationTarget_class != NULL);
235 ConfirmationTarget_LDKConfirmationTarget_Background = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_Background", "Lorg/ldk/enums/ConfirmationTarget;");
236 CHECK(ConfirmationTarget_LDKConfirmationTarget_Background != NULL);
237 ConfirmationTarget_LDKConfirmationTarget_Normal = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_Normal", "Lorg/ldk/enums/ConfirmationTarget;");
238 CHECK(ConfirmationTarget_LDKConfirmationTarget_Normal != NULL);
239 ConfirmationTarget_LDKConfirmationTarget_HighPriority = (*env)->GetStaticFieldID(env, ConfirmationTarget_class, "LDKConfirmationTarget_HighPriority", "Lorg/ldk/enums/ConfirmationTarget;");
240 CHECK(ConfirmationTarget_LDKConfirmationTarget_HighPriority != NULL);
242 static inline jclass LDKConfirmationTarget_to_java(JNIEnv *env, LDKConfirmationTarget val) {
244 case LDKConfirmationTarget_Background:
245 return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_Background);
246 case LDKConfirmationTarget_Normal:
247 return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_Normal);
248 case LDKConfirmationTarget_HighPriority:
249 return (*env)->GetStaticObjectField(env, ConfirmationTarget_class, ConfirmationTarget_LDKConfirmationTarget_HighPriority);
254 static inline LDKCreationError LDKCreationError_from_java(JNIEnv *env, jclass clz) {
255 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
256 if (UNLIKELY((*env)->ExceptionCheck(env))) {
257 (*env)->ExceptionDescribe(env);
258 (*env)->FatalError(env, "A call to CreationError.ordinal() from rust threw an exception.");
261 case 0: return LDKCreationError_DescriptionTooLong;
262 case 1: return LDKCreationError_RouteTooLong;
263 case 2: return LDKCreationError_TimestampOutOfBounds;
264 case 3: return LDKCreationError_InvalidAmount;
265 case 4: return LDKCreationError_MissingRouteHints;
266 case 5: return LDKCreationError_MinFinalCltvExpiryDeltaTooShort;
268 (*env)->FatalError(env, "A call to CreationError.ordinal() from rust returned an invalid value.");
269 abort(); // Unreachable, but will let the compiler know we don't return here
271 static jclass CreationError_class = NULL;
272 static jfieldID CreationError_LDKCreationError_DescriptionTooLong = NULL;
273 static jfieldID CreationError_LDKCreationError_RouteTooLong = NULL;
274 static jfieldID CreationError_LDKCreationError_TimestampOutOfBounds = NULL;
275 static jfieldID CreationError_LDKCreationError_InvalidAmount = NULL;
276 static jfieldID CreationError_LDKCreationError_MissingRouteHints = NULL;
277 static jfieldID CreationError_LDKCreationError_MinFinalCltvExpiryDeltaTooShort = NULL;
278 JNIEXPORT void JNICALL Java_org_ldk_enums_CreationError_init (JNIEnv *env, jclass clz) {
279 CreationError_class = (*env)->NewGlobalRef(env, clz);
280 CHECK(CreationError_class != NULL);
281 CreationError_LDKCreationError_DescriptionTooLong = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_DescriptionTooLong", "Lorg/ldk/enums/CreationError;");
282 CHECK(CreationError_LDKCreationError_DescriptionTooLong != NULL);
283 CreationError_LDKCreationError_RouteTooLong = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_RouteTooLong", "Lorg/ldk/enums/CreationError;");
284 CHECK(CreationError_LDKCreationError_RouteTooLong != NULL);
285 CreationError_LDKCreationError_TimestampOutOfBounds = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_TimestampOutOfBounds", "Lorg/ldk/enums/CreationError;");
286 CHECK(CreationError_LDKCreationError_TimestampOutOfBounds != NULL);
287 CreationError_LDKCreationError_InvalidAmount = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_InvalidAmount", "Lorg/ldk/enums/CreationError;");
288 CHECK(CreationError_LDKCreationError_InvalidAmount != NULL);
289 CreationError_LDKCreationError_MissingRouteHints = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_MissingRouteHints", "Lorg/ldk/enums/CreationError;");
290 CHECK(CreationError_LDKCreationError_MissingRouteHints != NULL);
291 CreationError_LDKCreationError_MinFinalCltvExpiryDeltaTooShort = (*env)->GetStaticFieldID(env, CreationError_class, "LDKCreationError_MinFinalCltvExpiryDeltaTooShort", "Lorg/ldk/enums/CreationError;");
292 CHECK(CreationError_LDKCreationError_MinFinalCltvExpiryDeltaTooShort != NULL);
294 static inline jclass LDKCreationError_to_java(JNIEnv *env, LDKCreationError val) {
296 case LDKCreationError_DescriptionTooLong:
297 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_DescriptionTooLong);
298 case LDKCreationError_RouteTooLong:
299 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_RouteTooLong);
300 case LDKCreationError_TimestampOutOfBounds:
301 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_TimestampOutOfBounds);
302 case LDKCreationError_InvalidAmount:
303 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_InvalidAmount);
304 case LDKCreationError_MissingRouteHints:
305 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_MissingRouteHints);
306 case LDKCreationError_MinFinalCltvExpiryDeltaTooShort:
307 return (*env)->GetStaticObjectField(env, CreationError_class, CreationError_LDKCreationError_MinFinalCltvExpiryDeltaTooShort);
312 static inline LDKCurrency LDKCurrency_from_java(JNIEnv *env, jclass clz) {
313 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
314 if (UNLIKELY((*env)->ExceptionCheck(env))) {
315 (*env)->ExceptionDescribe(env);
316 (*env)->FatalError(env, "A call to Currency.ordinal() from rust threw an exception.");
319 case 0: return LDKCurrency_Bitcoin;
320 case 1: return LDKCurrency_BitcoinTestnet;
321 case 2: return LDKCurrency_Regtest;
322 case 3: return LDKCurrency_Simnet;
323 case 4: return LDKCurrency_Signet;
325 (*env)->FatalError(env, "A call to Currency.ordinal() from rust returned an invalid value.");
326 abort(); // Unreachable, but will let the compiler know we don't return here
328 static jclass Currency_class = NULL;
329 static jfieldID Currency_LDKCurrency_Bitcoin = NULL;
330 static jfieldID Currency_LDKCurrency_BitcoinTestnet = NULL;
331 static jfieldID Currency_LDKCurrency_Regtest = NULL;
332 static jfieldID Currency_LDKCurrency_Simnet = NULL;
333 static jfieldID Currency_LDKCurrency_Signet = NULL;
334 JNIEXPORT void JNICALL Java_org_ldk_enums_Currency_init (JNIEnv *env, jclass clz) {
335 Currency_class = (*env)->NewGlobalRef(env, clz);
336 CHECK(Currency_class != NULL);
337 Currency_LDKCurrency_Bitcoin = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_Bitcoin", "Lorg/ldk/enums/Currency;");
338 CHECK(Currency_LDKCurrency_Bitcoin != NULL);
339 Currency_LDKCurrency_BitcoinTestnet = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_BitcoinTestnet", "Lorg/ldk/enums/Currency;");
340 CHECK(Currency_LDKCurrency_BitcoinTestnet != NULL);
341 Currency_LDKCurrency_Regtest = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_Regtest", "Lorg/ldk/enums/Currency;");
342 CHECK(Currency_LDKCurrency_Regtest != NULL);
343 Currency_LDKCurrency_Simnet = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_Simnet", "Lorg/ldk/enums/Currency;");
344 CHECK(Currency_LDKCurrency_Simnet != NULL);
345 Currency_LDKCurrency_Signet = (*env)->GetStaticFieldID(env, Currency_class, "LDKCurrency_Signet", "Lorg/ldk/enums/Currency;");
346 CHECK(Currency_LDKCurrency_Signet != NULL);
348 static inline jclass LDKCurrency_to_java(JNIEnv *env, LDKCurrency val) {
350 case LDKCurrency_Bitcoin:
351 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_Bitcoin);
352 case LDKCurrency_BitcoinTestnet:
353 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_BitcoinTestnet);
354 case LDKCurrency_Regtest:
355 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_Regtest);
356 case LDKCurrency_Simnet:
357 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_Simnet);
358 case LDKCurrency_Signet:
359 return (*env)->GetStaticObjectField(env, Currency_class, Currency_LDKCurrency_Signet);
364 static inline LDKFailureCode LDKFailureCode_from_java(JNIEnv *env, jclass clz) {
365 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
366 if (UNLIKELY((*env)->ExceptionCheck(env))) {
367 (*env)->ExceptionDescribe(env);
368 (*env)->FatalError(env, "A call to FailureCode.ordinal() from rust threw an exception.");
371 case 0: return LDKFailureCode_TemporaryNodeFailure;
372 case 1: return LDKFailureCode_RequiredNodeFeatureMissing;
373 case 2: return LDKFailureCode_IncorrectOrUnknownPaymentDetails;
375 (*env)->FatalError(env, "A call to FailureCode.ordinal() from rust returned an invalid value.");
376 abort(); // Unreachable, but will let the compiler know we don't return here
378 static jclass FailureCode_class = NULL;
379 static jfieldID FailureCode_LDKFailureCode_TemporaryNodeFailure = NULL;
380 static jfieldID FailureCode_LDKFailureCode_RequiredNodeFeatureMissing = NULL;
381 static jfieldID FailureCode_LDKFailureCode_IncorrectOrUnknownPaymentDetails = NULL;
382 JNIEXPORT void JNICALL Java_org_ldk_enums_FailureCode_init (JNIEnv *env, jclass clz) {
383 FailureCode_class = (*env)->NewGlobalRef(env, clz);
384 CHECK(FailureCode_class != NULL);
385 FailureCode_LDKFailureCode_TemporaryNodeFailure = (*env)->GetStaticFieldID(env, FailureCode_class, "LDKFailureCode_TemporaryNodeFailure", "Lorg/ldk/enums/FailureCode;");
386 CHECK(FailureCode_LDKFailureCode_TemporaryNodeFailure != NULL);
387 FailureCode_LDKFailureCode_RequiredNodeFeatureMissing = (*env)->GetStaticFieldID(env, FailureCode_class, "LDKFailureCode_RequiredNodeFeatureMissing", "Lorg/ldk/enums/FailureCode;");
388 CHECK(FailureCode_LDKFailureCode_RequiredNodeFeatureMissing != NULL);
389 FailureCode_LDKFailureCode_IncorrectOrUnknownPaymentDetails = (*env)->GetStaticFieldID(env, FailureCode_class, "LDKFailureCode_IncorrectOrUnknownPaymentDetails", "Lorg/ldk/enums/FailureCode;");
390 CHECK(FailureCode_LDKFailureCode_IncorrectOrUnknownPaymentDetails != NULL);
392 static inline jclass LDKFailureCode_to_java(JNIEnv *env, LDKFailureCode val) {
394 case LDKFailureCode_TemporaryNodeFailure:
395 return (*env)->GetStaticObjectField(env, FailureCode_class, FailureCode_LDKFailureCode_TemporaryNodeFailure);
396 case LDKFailureCode_RequiredNodeFeatureMissing:
397 return (*env)->GetStaticObjectField(env, FailureCode_class, FailureCode_LDKFailureCode_RequiredNodeFeatureMissing);
398 case LDKFailureCode_IncorrectOrUnknownPaymentDetails:
399 return (*env)->GetStaticObjectField(env, FailureCode_class, FailureCode_LDKFailureCode_IncorrectOrUnknownPaymentDetails);
404 static inline LDKHTLCClaim LDKHTLCClaim_from_java(JNIEnv *env, jclass clz) {
405 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
406 if (UNLIKELY((*env)->ExceptionCheck(env))) {
407 (*env)->ExceptionDescribe(env);
408 (*env)->FatalError(env, "A call to HTLCClaim.ordinal() from rust threw an exception.");
411 case 0: return LDKHTLCClaim_OfferedTimeout;
412 case 1: return LDKHTLCClaim_OfferedPreimage;
413 case 2: return LDKHTLCClaim_AcceptedTimeout;
414 case 3: return LDKHTLCClaim_AcceptedPreimage;
415 case 4: return LDKHTLCClaim_Revocation;
417 (*env)->FatalError(env, "A call to HTLCClaim.ordinal() from rust returned an invalid value.");
418 abort(); // Unreachable, but will let the compiler know we don't return here
420 static jclass HTLCClaim_class = NULL;
421 static jfieldID HTLCClaim_LDKHTLCClaim_OfferedTimeout = NULL;
422 static jfieldID HTLCClaim_LDKHTLCClaim_OfferedPreimage = NULL;
423 static jfieldID HTLCClaim_LDKHTLCClaim_AcceptedTimeout = NULL;
424 static jfieldID HTLCClaim_LDKHTLCClaim_AcceptedPreimage = NULL;
425 static jfieldID HTLCClaim_LDKHTLCClaim_Revocation = NULL;
426 JNIEXPORT void JNICALL Java_org_ldk_enums_HTLCClaim_init (JNIEnv *env, jclass clz) {
427 HTLCClaim_class = (*env)->NewGlobalRef(env, clz);
428 CHECK(HTLCClaim_class != NULL);
429 HTLCClaim_LDKHTLCClaim_OfferedTimeout = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_OfferedTimeout", "Lorg/ldk/enums/HTLCClaim;");
430 CHECK(HTLCClaim_LDKHTLCClaim_OfferedTimeout != NULL);
431 HTLCClaim_LDKHTLCClaim_OfferedPreimage = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_OfferedPreimage", "Lorg/ldk/enums/HTLCClaim;");
432 CHECK(HTLCClaim_LDKHTLCClaim_OfferedPreimage != NULL);
433 HTLCClaim_LDKHTLCClaim_AcceptedTimeout = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_AcceptedTimeout", "Lorg/ldk/enums/HTLCClaim;");
434 CHECK(HTLCClaim_LDKHTLCClaim_AcceptedTimeout != NULL);
435 HTLCClaim_LDKHTLCClaim_AcceptedPreimage = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_AcceptedPreimage", "Lorg/ldk/enums/HTLCClaim;");
436 CHECK(HTLCClaim_LDKHTLCClaim_AcceptedPreimage != NULL);
437 HTLCClaim_LDKHTLCClaim_Revocation = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_Revocation", "Lorg/ldk/enums/HTLCClaim;");
438 CHECK(HTLCClaim_LDKHTLCClaim_Revocation != NULL);
440 static inline jclass LDKHTLCClaim_to_java(JNIEnv *env, LDKHTLCClaim val) {
442 case LDKHTLCClaim_OfferedTimeout:
443 return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_OfferedTimeout);
444 case LDKHTLCClaim_OfferedPreimage:
445 return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_OfferedPreimage);
446 case LDKHTLCClaim_AcceptedTimeout:
447 return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_AcceptedTimeout);
448 case LDKHTLCClaim_AcceptedPreimage:
449 return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_AcceptedPreimage);
450 case LDKHTLCClaim_Revocation:
451 return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_Revocation);
456 static inline LDKIOError LDKIOError_from_java(JNIEnv *env, jclass clz) {
457 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
458 if (UNLIKELY((*env)->ExceptionCheck(env))) {
459 (*env)->ExceptionDescribe(env);
460 (*env)->FatalError(env, "A call to IOError.ordinal() from rust threw an exception.");
463 case 0: return LDKIOError_NotFound;
464 case 1: return LDKIOError_PermissionDenied;
465 case 2: return LDKIOError_ConnectionRefused;
466 case 3: return LDKIOError_ConnectionReset;
467 case 4: return LDKIOError_ConnectionAborted;
468 case 5: return LDKIOError_NotConnected;
469 case 6: return LDKIOError_AddrInUse;
470 case 7: return LDKIOError_AddrNotAvailable;
471 case 8: return LDKIOError_BrokenPipe;
472 case 9: return LDKIOError_AlreadyExists;
473 case 10: return LDKIOError_WouldBlock;
474 case 11: return LDKIOError_InvalidInput;
475 case 12: return LDKIOError_InvalidData;
476 case 13: return LDKIOError_TimedOut;
477 case 14: return LDKIOError_WriteZero;
478 case 15: return LDKIOError_Interrupted;
479 case 16: return LDKIOError_Other;
480 case 17: return LDKIOError_UnexpectedEof;
482 (*env)->FatalError(env, "A call to IOError.ordinal() from rust returned an invalid value.");
483 abort(); // Unreachable, but will let the compiler know we don't return here
485 static jclass IOError_class = NULL;
486 static jfieldID IOError_LDKIOError_NotFound = NULL;
487 static jfieldID IOError_LDKIOError_PermissionDenied = NULL;
488 static jfieldID IOError_LDKIOError_ConnectionRefused = NULL;
489 static jfieldID IOError_LDKIOError_ConnectionReset = NULL;
490 static jfieldID IOError_LDKIOError_ConnectionAborted = NULL;
491 static jfieldID IOError_LDKIOError_NotConnected = NULL;
492 static jfieldID IOError_LDKIOError_AddrInUse = NULL;
493 static jfieldID IOError_LDKIOError_AddrNotAvailable = NULL;
494 static jfieldID IOError_LDKIOError_BrokenPipe = NULL;
495 static jfieldID IOError_LDKIOError_AlreadyExists = NULL;
496 static jfieldID IOError_LDKIOError_WouldBlock = NULL;
497 static jfieldID IOError_LDKIOError_InvalidInput = NULL;
498 static jfieldID IOError_LDKIOError_InvalidData = NULL;
499 static jfieldID IOError_LDKIOError_TimedOut = NULL;
500 static jfieldID IOError_LDKIOError_WriteZero = NULL;
501 static jfieldID IOError_LDKIOError_Interrupted = NULL;
502 static jfieldID IOError_LDKIOError_Other = NULL;
503 static jfieldID IOError_LDKIOError_UnexpectedEof = NULL;
504 JNIEXPORT void JNICALL Java_org_ldk_enums_IOError_init (JNIEnv *env, jclass clz) {
505 IOError_class = (*env)->NewGlobalRef(env, clz);
506 CHECK(IOError_class != NULL);
507 IOError_LDKIOError_NotFound = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_NotFound", "Lorg/ldk/enums/IOError;");
508 CHECK(IOError_LDKIOError_NotFound != NULL);
509 IOError_LDKIOError_PermissionDenied = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_PermissionDenied", "Lorg/ldk/enums/IOError;");
510 CHECK(IOError_LDKIOError_PermissionDenied != NULL);
511 IOError_LDKIOError_ConnectionRefused = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_ConnectionRefused", "Lorg/ldk/enums/IOError;");
512 CHECK(IOError_LDKIOError_ConnectionRefused != NULL);
513 IOError_LDKIOError_ConnectionReset = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_ConnectionReset", "Lorg/ldk/enums/IOError;");
514 CHECK(IOError_LDKIOError_ConnectionReset != NULL);
515 IOError_LDKIOError_ConnectionAborted = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_ConnectionAborted", "Lorg/ldk/enums/IOError;");
516 CHECK(IOError_LDKIOError_ConnectionAborted != NULL);
517 IOError_LDKIOError_NotConnected = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_NotConnected", "Lorg/ldk/enums/IOError;");
518 CHECK(IOError_LDKIOError_NotConnected != NULL);
519 IOError_LDKIOError_AddrInUse = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_AddrInUse", "Lorg/ldk/enums/IOError;");
520 CHECK(IOError_LDKIOError_AddrInUse != NULL);
521 IOError_LDKIOError_AddrNotAvailable = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_AddrNotAvailable", "Lorg/ldk/enums/IOError;");
522 CHECK(IOError_LDKIOError_AddrNotAvailable != NULL);
523 IOError_LDKIOError_BrokenPipe = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_BrokenPipe", "Lorg/ldk/enums/IOError;");
524 CHECK(IOError_LDKIOError_BrokenPipe != NULL);
525 IOError_LDKIOError_AlreadyExists = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_AlreadyExists", "Lorg/ldk/enums/IOError;");
526 CHECK(IOError_LDKIOError_AlreadyExists != NULL);
527 IOError_LDKIOError_WouldBlock = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_WouldBlock", "Lorg/ldk/enums/IOError;");
528 CHECK(IOError_LDKIOError_WouldBlock != NULL);
529 IOError_LDKIOError_InvalidInput = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_InvalidInput", "Lorg/ldk/enums/IOError;");
530 CHECK(IOError_LDKIOError_InvalidInput != NULL);
531 IOError_LDKIOError_InvalidData = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_InvalidData", "Lorg/ldk/enums/IOError;");
532 CHECK(IOError_LDKIOError_InvalidData != NULL);
533 IOError_LDKIOError_TimedOut = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_TimedOut", "Lorg/ldk/enums/IOError;");
534 CHECK(IOError_LDKIOError_TimedOut != NULL);
535 IOError_LDKIOError_WriteZero = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_WriteZero", "Lorg/ldk/enums/IOError;");
536 CHECK(IOError_LDKIOError_WriteZero != NULL);
537 IOError_LDKIOError_Interrupted = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_Interrupted", "Lorg/ldk/enums/IOError;");
538 CHECK(IOError_LDKIOError_Interrupted != NULL);
539 IOError_LDKIOError_Other = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_Other", "Lorg/ldk/enums/IOError;");
540 CHECK(IOError_LDKIOError_Other != NULL);
541 IOError_LDKIOError_UnexpectedEof = (*env)->GetStaticFieldID(env, IOError_class, "LDKIOError_UnexpectedEof", "Lorg/ldk/enums/IOError;");
542 CHECK(IOError_LDKIOError_UnexpectedEof != NULL);
544 static inline jclass LDKIOError_to_java(JNIEnv *env, LDKIOError val) {
546 case LDKIOError_NotFound:
547 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_NotFound);
548 case LDKIOError_PermissionDenied:
549 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_PermissionDenied);
550 case LDKIOError_ConnectionRefused:
551 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_ConnectionRefused);
552 case LDKIOError_ConnectionReset:
553 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_ConnectionReset);
554 case LDKIOError_ConnectionAborted:
555 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_ConnectionAborted);
556 case LDKIOError_NotConnected:
557 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_NotConnected);
558 case LDKIOError_AddrInUse:
559 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_AddrInUse);
560 case LDKIOError_AddrNotAvailable:
561 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_AddrNotAvailable);
562 case LDKIOError_BrokenPipe:
563 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_BrokenPipe);
564 case LDKIOError_AlreadyExists:
565 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_AlreadyExists);
566 case LDKIOError_WouldBlock:
567 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_WouldBlock);
568 case LDKIOError_InvalidInput:
569 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_InvalidInput);
570 case LDKIOError_InvalidData:
571 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_InvalidData);
572 case LDKIOError_TimedOut:
573 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_TimedOut);
574 case LDKIOError_WriteZero:
575 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_WriteZero);
576 case LDKIOError_Interrupted:
577 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_Interrupted);
578 case LDKIOError_Other:
579 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_Other);
580 case LDKIOError_UnexpectedEof:
581 return (*env)->GetStaticObjectField(env, IOError_class, IOError_LDKIOError_UnexpectedEof);
586 static inline LDKLevel LDKLevel_from_java(JNIEnv *env, jclass clz) {
587 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
588 if (UNLIKELY((*env)->ExceptionCheck(env))) {
589 (*env)->ExceptionDescribe(env);
590 (*env)->FatalError(env, "A call to Level.ordinal() from rust threw an exception.");
593 case 0: return LDKLevel_Gossip;
594 case 1: return LDKLevel_Trace;
595 case 2: return LDKLevel_Debug;
596 case 3: return LDKLevel_Info;
597 case 4: return LDKLevel_Warn;
598 case 5: return LDKLevel_Error;
600 (*env)->FatalError(env, "A call to Level.ordinal() from rust returned an invalid value.");
601 abort(); // Unreachable, but will let the compiler know we don't return here
603 static jclass Level_class = NULL;
604 static jfieldID Level_LDKLevel_Gossip = NULL;
605 static jfieldID Level_LDKLevel_Trace = NULL;
606 static jfieldID Level_LDKLevel_Debug = NULL;
607 static jfieldID Level_LDKLevel_Info = NULL;
608 static jfieldID Level_LDKLevel_Warn = NULL;
609 static jfieldID Level_LDKLevel_Error = NULL;
610 JNIEXPORT void JNICALL Java_org_ldk_enums_Level_init (JNIEnv *env, jclass clz) {
611 Level_class = (*env)->NewGlobalRef(env, clz);
612 CHECK(Level_class != NULL);
613 Level_LDKLevel_Gossip = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Gossip", "Lorg/ldk/enums/Level;");
614 CHECK(Level_LDKLevel_Gossip != NULL);
615 Level_LDKLevel_Trace = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Trace", "Lorg/ldk/enums/Level;");
616 CHECK(Level_LDKLevel_Trace != NULL);
617 Level_LDKLevel_Debug = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Debug", "Lorg/ldk/enums/Level;");
618 CHECK(Level_LDKLevel_Debug != NULL);
619 Level_LDKLevel_Info = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Info", "Lorg/ldk/enums/Level;");
620 CHECK(Level_LDKLevel_Info != NULL);
621 Level_LDKLevel_Warn = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Warn", "Lorg/ldk/enums/Level;");
622 CHECK(Level_LDKLevel_Warn != NULL);
623 Level_LDKLevel_Error = (*env)->GetStaticFieldID(env, Level_class, "LDKLevel_Error", "Lorg/ldk/enums/Level;");
624 CHECK(Level_LDKLevel_Error != NULL);
626 static inline jclass LDKLevel_to_java(JNIEnv *env, LDKLevel val) {
628 case LDKLevel_Gossip:
629 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Gossip);
631 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Trace);
633 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Debug);
635 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Info);
637 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Warn);
639 return (*env)->GetStaticObjectField(env, Level_class, Level_LDKLevel_Error);
644 static inline LDKNetwork LDKNetwork_from_java(JNIEnv *env, jclass clz) {
645 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
646 if (UNLIKELY((*env)->ExceptionCheck(env))) {
647 (*env)->ExceptionDescribe(env);
648 (*env)->FatalError(env, "A call to Network.ordinal() from rust threw an exception.");
651 case 0: return LDKNetwork_Bitcoin;
652 case 1: return LDKNetwork_Testnet;
653 case 2: return LDKNetwork_Regtest;
654 case 3: return LDKNetwork_Signet;
656 (*env)->FatalError(env, "A call to Network.ordinal() from rust returned an invalid value.");
657 abort(); // Unreachable, but will let the compiler know we don't return here
659 static jclass Network_class = NULL;
660 static jfieldID Network_LDKNetwork_Bitcoin = NULL;
661 static jfieldID Network_LDKNetwork_Testnet = NULL;
662 static jfieldID Network_LDKNetwork_Regtest = NULL;
663 static jfieldID Network_LDKNetwork_Signet = NULL;
664 JNIEXPORT void JNICALL Java_org_ldk_enums_Network_init (JNIEnv *env, jclass clz) {
665 Network_class = (*env)->NewGlobalRef(env, clz);
666 CHECK(Network_class != NULL);
667 Network_LDKNetwork_Bitcoin = (*env)->GetStaticFieldID(env, Network_class, "LDKNetwork_Bitcoin", "Lorg/ldk/enums/Network;");
668 CHECK(Network_LDKNetwork_Bitcoin != NULL);
669 Network_LDKNetwork_Testnet = (*env)->GetStaticFieldID(env, Network_class, "LDKNetwork_Testnet", "Lorg/ldk/enums/Network;");
670 CHECK(Network_LDKNetwork_Testnet != NULL);
671 Network_LDKNetwork_Regtest = (*env)->GetStaticFieldID(env, Network_class, "LDKNetwork_Regtest", "Lorg/ldk/enums/Network;");
672 CHECK(Network_LDKNetwork_Regtest != NULL);
673 Network_LDKNetwork_Signet = (*env)->GetStaticFieldID(env, Network_class, "LDKNetwork_Signet", "Lorg/ldk/enums/Network;");
674 CHECK(Network_LDKNetwork_Signet != NULL);
676 static inline jclass LDKNetwork_to_java(JNIEnv *env, LDKNetwork val) {
678 case LDKNetwork_Bitcoin:
679 return (*env)->GetStaticObjectField(env, Network_class, Network_LDKNetwork_Bitcoin);
680 case LDKNetwork_Testnet:
681 return (*env)->GetStaticObjectField(env, Network_class, Network_LDKNetwork_Testnet);
682 case LDKNetwork_Regtest:
683 return (*env)->GetStaticObjectField(env, Network_class, Network_LDKNetwork_Regtest);
684 case LDKNetwork_Signet:
685 return (*env)->GetStaticObjectField(env, Network_class, Network_LDKNetwork_Signet);
690 static inline LDKPaymentFailureReason LDKPaymentFailureReason_from_java(JNIEnv *env, jclass clz) {
691 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
692 if (UNLIKELY((*env)->ExceptionCheck(env))) {
693 (*env)->ExceptionDescribe(env);
694 (*env)->FatalError(env, "A call to PaymentFailureReason.ordinal() from rust threw an exception.");
697 case 0: return LDKPaymentFailureReason_RecipientRejected;
698 case 1: return LDKPaymentFailureReason_UserAbandoned;
699 case 2: return LDKPaymentFailureReason_RetriesExhausted;
700 case 3: return LDKPaymentFailureReason_PaymentExpired;
701 case 4: return LDKPaymentFailureReason_RouteNotFound;
702 case 5: return LDKPaymentFailureReason_UnexpectedError;
704 (*env)->FatalError(env, "A call to PaymentFailureReason.ordinal() from rust returned an invalid value.");
705 abort(); // Unreachable, but will let the compiler know we don't return here
707 static jclass PaymentFailureReason_class = NULL;
708 static jfieldID PaymentFailureReason_LDKPaymentFailureReason_RecipientRejected = NULL;
709 static jfieldID PaymentFailureReason_LDKPaymentFailureReason_UserAbandoned = NULL;
710 static jfieldID PaymentFailureReason_LDKPaymentFailureReason_RetriesExhausted = NULL;
711 static jfieldID PaymentFailureReason_LDKPaymentFailureReason_PaymentExpired = NULL;
712 static jfieldID PaymentFailureReason_LDKPaymentFailureReason_RouteNotFound = NULL;
713 static jfieldID PaymentFailureReason_LDKPaymentFailureReason_UnexpectedError = NULL;
714 JNIEXPORT void JNICALL Java_org_ldk_enums_PaymentFailureReason_init (JNIEnv *env, jclass clz) {
715 PaymentFailureReason_class = (*env)->NewGlobalRef(env, clz);
716 CHECK(PaymentFailureReason_class != NULL);
717 PaymentFailureReason_LDKPaymentFailureReason_RecipientRejected = (*env)->GetStaticFieldID(env, PaymentFailureReason_class, "LDKPaymentFailureReason_RecipientRejected", "Lorg/ldk/enums/PaymentFailureReason;");
718 CHECK(PaymentFailureReason_LDKPaymentFailureReason_RecipientRejected != NULL);
719 PaymentFailureReason_LDKPaymentFailureReason_UserAbandoned = (*env)->GetStaticFieldID(env, PaymentFailureReason_class, "LDKPaymentFailureReason_UserAbandoned", "Lorg/ldk/enums/PaymentFailureReason;");
720 CHECK(PaymentFailureReason_LDKPaymentFailureReason_UserAbandoned != NULL);
721 PaymentFailureReason_LDKPaymentFailureReason_RetriesExhausted = (*env)->GetStaticFieldID(env, PaymentFailureReason_class, "LDKPaymentFailureReason_RetriesExhausted", "Lorg/ldk/enums/PaymentFailureReason;");
722 CHECK(PaymentFailureReason_LDKPaymentFailureReason_RetriesExhausted != NULL);
723 PaymentFailureReason_LDKPaymentFailureReason_PaymentExpired = (*env)->GetStaticFieldID(env, PaymentFailureReason_class, "LDKPaymentFailureReason_PaymentExpired", "Lorg/ldk/enums/PaymentFailureReason;");
724 CHECK(PaymentFailureReason_LDKPaymentFailureReason_PaymentExpired != NULL);
725 PaymentFailureReason_LDKPaymentFailureReason_RouteNotFound = (*env)->GetStaticFieldID(env, PaymentFailureReason_class, "LDKPaymentFailureReason_RouteNotFound", "Lorg/ldk/enums/PaymentFailureReason;");
726 CHECK(PaymentFailureReason_LDKPaymentFailureReason_RouteNotFound != NULL);
727 PaymentFailureReason_LDKPaymentFailureReason_UnexpectedError = (*env)->GetStaticFieldID(env, PaymentFailureReason_class, "LDKPaymentFailureReason_UnexpectedError", "Lorg/ldk/enums/PaymentFailureReason;");
728 CHECK(PaymentFailureReason_LDKPaymentFailureReason_UnexpectedError != NULL);
730 static inline jclass LDKPaymentFailureReason_to_java(JNIEnv *env, LDKPaymentFailureReason val) {
732 case LDKPaymentFailureReason_RecipientRejected:
733 return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_RecipientRejected);
734 case LDKPaymentFailureReason_UserAbandoned:
735 return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_UserAbandoned);
736 case LDKPaymentFailureReason_RetriesExhausted:
737 return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_RetriesExhausted);
738 case LDKPaymentFailureReason_PaymentExpired:
739 return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_PaymentExpired);
740 case LDKPaymentFailureReason_RouteNotFound:
741 return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_RouteNotFound);
742 case LDKPaymentFailureReason_UnexpectedError:
743 return (*env)->GetStaticObjectField(env, PaymentFailureReason_class, PaymentFailureReason_LDKPaymentFailureReason_UnexpectedError);
748 static inline LDKRecipient LDKRecipient_from_java(JNIEnv *env, jclass clz) {
749 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
750 if (UNLIKELY((*env)->ExceptionCheck(env))) {
751 (*env)->ExceptionDescribe(env);
752 (*env)->FatalError(env, "A call to Recipient.ordinal() from rust threw an exception.");
755 case 0: return LDKRecipient_Node;
756 case 1: return LDKRecipient_PhantomNode;
758 (*env)->FatalError(env, "A call to Recipient.ordinal() from rust returned an invalid value.");
759 abort(); // Unreachable, but will let the compiler know we don't return here
761 static jclass Recipient_class = NULL;
762 static jfieldID Recipient_LDKRecipient_Node = NULL;
763 static jfieldID Recipient_LDKRecipient_PhantomNode = NULL;
764 JNIEXPORT void JNICALL Java_org_ldk_enums_Recipient_init (JNIEnv *env, jclass clz) {
765 Recipient_class = (*env)->NewGlobalRef(env, clz);
766 CHECK(Recipient_class != NULL);
767 Recipient_LDKRecipient_Node = (*env)->GetStaticFieldID(env, Recipient_class, "LDKRecipient_Node", "Lorg/ldk/enums/Recipient;");
768 CHECK(Recipient_LDKRecipient_Node != NULL);
769 Recipient_LDKRecipient_PhantomNode = (*env)->GetStaticFieldID(env, Recipient_class, "LDKRecipient_PhantomNode", "Lorg/ldk/enums/Recipient;");
770 CHECK(Recipient_LDKRecipient_PhantomNode != NULL);
772 static inline jclass LDKRecipient_to_java(JNIEnv *env, LDKRecipient val) {
774 case LDKRecipient_Node:
775 return (*env)->GetStaticObjectField(env, Recipient_class, Recipient_LDKRecipient_Node);
776 case LDKRecipient_PhantomNode:
777 return (*env)->GetStaticObjectField(env, Recipient_class, Recipient_LDKRecipient_PhantomNode);
782 static inline LDKRetryableSendFailure LDKRetryableSendFailure_from_java(JNIEnv *env, jclass clz) {
783 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
784 if (UNLIKELY((*env)->ExceptionCheck(env))) {
785 (*env)->ExceptionDescribe(env);
786 (*env)->FatalError(env, "A call to RetryableSendFailure.ordinal() from rust threw an exception.");
789 case 0: return LDKRetryableSendFailure_PaymentExpired;
790 case 1: return LDKRetryableSendFailure_RouteNotFound;
791 case 2: return LDKRetryableSendFailure_DuplicatePayment;
793 (*env)->FatalError(env, "A call to RetryableSendFailure.ordinal() from rust returned an invalid value.");
794 abort(); // Unreachable, but will let the compiler know we don't return here
796 static jclass RetryableSendFailure_class = NULL;
797 static jfieldID RetryableSendFailure_LDKRetryableSendFailure_PaymentExpired = NULL;
798 static jfieldID RetryableSendFailure_LDKRetryableSendFailure_RouteNotFound = NULL;
799 static jfieldID RetryableSendFailure_LDKRetryableSendFailure_DuplicatePayment = NULL;
800 JNIEXPORT void JNICALL Java_org_ldk_enums_RetryableSendFailure_init (JNIEnv *env, jclass clz) {
801 RetryableSendFailure_class = (*env)->NewGlobalRef(env, clz);
802 CHECK(RetryableSendFailure_class != NULL);
803 RetryableSendFailure_LDKRetryableSendFailure_PaymentExpired = (*env)->GetStaticFieldID(env, RetryableSendFailure_class, "LDKRetryableSendFailure_PaymentExpired", "Lorg/ldk/enums/RetryableSendFailure;");
804 CHECK(RetryableSendFailure_LDKRetryableSendFailure_PaymentExpired != NULL);
805 RetryableSendFailure_LDKRetryableSendFailure_RouteNotFound = (*env)->GetStaticFieldID(env, RetryableSendFailure_class, "LDKRetryableSendFailure_RouteNotFound", "Lorg/ldk/enums/RetryableSendFailure;");
806 CHECK(RetryableSendFailure_LDKRetryableSendFailure_RouteNotFound != NULL);
807 RetryableSendFailure_LDKRetryableSendFailure_DuplicatePayment = (*env)->GetStaticFieldID(env, RetryableSendFailure_class, "LDKRetryableSendFailure_DuplicatePayment", "Lorg/ldk/enums/RetryableSendFailure;");
808 CHECK(RetryableSendFailure_LDKRetryableSendFailure_DuplicatePayment != NULL);
810 static inline jclass LDKRetryableSendFailure_to_java(JNIEnv *env, LDKRetryableSendFailure val) {
812 case LDKRetryableSendFailure_PaymentExpired:
813 return (*env)->GetStaticObjectField(env, RetryableSendFailure_class, RetryableSendFailure_LDKRetryableSendFailure_PaymentExpired);
814 case LDKRetryableSendFailure_RouteNotFound:
815 return (*env)->GetStaticObjectField(env, RetryableSendFailure_class, RetryableSendFailure_LDKRetryableSendFailure_RouteNotFound);
816 case LDKRetryableSendFailure_DuplicatePayment:
817 return (*env)->GetStaticObjectField(env, RetryableSendFailure_class, RetryableSendFailure_LDKRetryableSendFailure_DuplicatePayment);
822 static inline LDKSecp256k1Error LDKSecp256k1Error_from_java(JNIEnv *env, jclass clz) {
823 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
824 if (UNLIKELY((*env)->ExceptionCheck(env))) {
825 (*env)->ExceptionDescribe(env);
826 (*env)->FatalError(env, "A call to Secp256k1Error.ordinal() from rust threw an exception.");
829 case 0: return LDKSecp256k1Error_IncorrectSignature;
830 case 1: return LDKSecp256k1Error_InvalidMessage;
831 case 2: return LDKSecp256k1Error_InvalidPublicKey;
832 case 3: return LDKSecp256k1Error_InvalidSignature;
833 case 4: return LDKSecp256k1Error_InvalidSecretKey;
834 case 5: return LDKSecp256k1Error_InvalidSharedSecret;
835 case 6: return LDKSecp256k1Error_InvalidRecoveryId;
836 case 7: return LDKSecp256k1Error_InvalidTweak;
837 case 8: return LDKSecp256k1Error_NotEnoughMemory;
838 case 9: return LDKSecp256k1Error_InvalidPublicKeySum;
839 case 10: return LDKSecp256k1Error_InvalidParityValue;
841 (*env)->FatalError(env, "A call to Secp256k1Error.ordinal() from rust returned an invalid value.");
842 abort(); // Unreachable, but will let the compiler know we don't return here
844 static jclass Secp256k1Error_class = NULL;
845 static jfieldID Secp256k1Error_LDKSecp256k1Error_IncorrectSignature = NULL;
846 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidMessage = NULL;
847 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidPublicKey = NULL;
848 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidSignature = NULL;
849 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey = NULL;
850 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret = NULL;
851 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId = NULL;
852 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidTweak = NULL;
853 static jfieldID Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory = NULL;
854 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum = NULL;
855 static jfieldID Secp256k1Error_LDKSecp256k1Error_InvalidParityValue = NULL;
856 JNIEXPORT void JNICALL Java_org_ldk_enums_Secp256k1Error_init (JNIEnv *env, jclass clz) {
857 Secp256k1Error_class = (*env)->NewGlobalRef(env, clz);
858 CHECK(Secp256k1Error_class != NULL);
859 Secp256k1Error_LDKSecp256k1Error_IncorrectSignature = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_IncorrectSignature", "Lorg/ldk/enums/Secp256k1Error;");
860 CHECK(Secp256k1Error_LDKSecp256k1Error_IncorrectSignature != NULL);
861 Secp256k1Error_LDKSecp256k1Error_InvalidMessage = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidMessage", "Lorg/ldk/enums/Secp256k1Error;");
862 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidMessage != NULL);
863 Secp256k1Error_LDKSecp256k1Error_InvalidPublicKey = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidPublicKey", "Lorg/ldk/enums/Secp256k1Error;");
864 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidPublicKey != NULL);
865 Secp256k1Error_LDKSecp256k1Error_InvalidSignature = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidSignature", "Lorg/ldk/enums/Secp256k1Error;");
866 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidSignature != NULL);
867 Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidSecretKey", "Lorg/ldk/enums/Secp256k1Error;");
868 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey != NULL);
869 Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidSharedSecret", "Lorg/ldk/enums/Secp256k1Error;");
870 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret != NULL);
871 Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidRecoveryId", "Lorg/ldk/enums/Secp256k1Error;");
872 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId != NULL);
873 Secp256k1Error_LDKSecp256k1Error_InvalidTweak = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidTweak", "Lorg/ldk/enums/Secp256k1Error;");
874 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidTweak != NULL);
875 Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_NotEnoughMemory", "Lorg/ldk/enums/Secp256k1Error;");
876 CHECK(Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory != NULL);
877 Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidPublicKeySum", "Lorg/ldk/enums/Secp256k1Error;");
878 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum != NULL);
879 Secp256k1Error_LDKSecp256k1Error_InvalidParityValue = (*env)->GetStaticFieldID(env, Secp256k1Error_class, "LDKSecp256k1Error_InvalidParityValue", "Lorg/ldk/enums/Secp256k1Error;");
880 CHECK(Secp256k1Error_LDKSecp256k1Error_InvalidParityValue != NULL);
882 static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error val) {
884 case LDKSecp256k1Error_IncorrectSignature:
885 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_IncorrectSignature);
886 case LDKSecp256k1Error_InvalidMessage:
887 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidMessage);
888 case LDKSecp256k1Error_InvalidPublicKey:
889 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidPublicKey);
890 case LDKSecp256k1Error_InvalidSignature:
891 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidSignature);
892 case LDKSecp256k1Error_InvalidSecretKey:
893 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidSecretKey);
894 case LDKSecp256k1Error_InvalidSharedSecret:
895 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidSharedSecret);
896 case LDKSecp256k1Error_InvalidRecoveryId:
897 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidRecoveryId);
898 case LDKSecp256k1Error_InvalidTweak:
899 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidTweak);
900 case LDKSecp256k1Error_NotEnoughMemory:
901 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_NotEnoughMemory);
902 case LDKSecp256k1Error_InvalidPublicKeySum:
903 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidPublicKeySum);
904 case LDKSecp256k1Error_InvalidParityValue:
905 return (*env)->GetStaticObjectField(env, Secp256k1Error_class, Secp256k1Error_LDKSecp256k1Error_InvalidParityValue);
910 static inline LDKSemanticError LDKSemanticError_from_java(JNIEnv *env, jclass clz) {
911 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
912 if (UNLIKELY((*env)->ExceptionCheck(env))) {
913 (*env)->ExceptionDescribe(env);
914 (*env)->FatalError(env, "A call to SemanticError.ordinal() from rust threw an exception.");
917 case 0: return LDKSemanticError_NoPaymentHash;
918 case 1: return LDKSemanticError_MultiplePaymentHashes;
919 case 2: return LDKSemanticError_NoDescription;
920 case 3: return LDKSemanticError_MultipleDescriptions;
921 case 4: return LDKSemanticError_NoPaymentSecret;
922 case 5: return LDKSemanticError_MultiplePaymentSecrets;
923 case 6: return LDKSemanticError_InvalidFeatures;
924 case 7: return LDKSemanticError_InvalidRecoveryId;
925 case 8: return LDKSemanticError_InvalidSignature;
926 case 9: return LDKSemanticError_ImpreciseAmount;
928 (*env)->FatalError(env, "A call to SemanticError.ordinal() from rust returned an invalid value.");
929 abort(); // Unreachable, but will let the compiler know we don't return here
931 static jclass SemanticError_class = NULL;
932 static jfieldID SemanticError_LDKSemanticError_NoPaymentHash = NULL;
933 static jfieldID SemanticError_LDKSemanticError_MultiplePaymentHashes = NULL;
934 static jfieldID SemanticError_LDKSemanticError_NoDescription = NULL;
935 static jfieldID SemanticError_LDKSemanticError_MultipleDescriptions = NULL;
936 static jfieldID SemanticError_LDKSemanticError_NoPaymentSecret = NULL;
937 static jfieldID SemanticError_LDKSemanticError_MultiplePaymentSecrets = NULL;
938 static jfieldID SemanticError_LDKSemanticError_InvalidFeatures = NULL;
939 static jfieldID SemanticError_LDKSemanticError_InvalidRecoveryId = NULL;
940 static jfieldID SemanticError_LDKSemanticError_InvalidSignature = NULL;
941 static jfieldID SemanticError_LDKSemanticError_ImpreciseAmount = NULL;
942 JNIEXPORT void JNICALL Java_org_ldk_enums_SemanticError_init (JNIEnv *env, jclass clz) {
943 SemanticError_class = (*env)->NewGlobalRef(env, clz);
944 CHECK(SemanticError_class != NULL);
945 SemanticError_LDKSemanticError_NoPaymentHash = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_NoPaymentHash", "Lorg/ldk/enums/SemanticError;");
946 CHECK(SemanticError_LDKSemanticError_NoPaymentHash != NULL);
947 SemanticError_LDKSemanticError_MultiplePaymentHashes = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_MultiplePaymentHashes", "Lorg/ldk/enums/SemanticError;");
948 CHECK(SemanticError_LDKSemanticError_MultiplePaymentHashes != NULL);
949 SemanticError_LDKSemanticError_NoDescription = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_NoDescription", "Lorg/ldk/enums/SemanticError;");
950 CHECK(SemanticError_LDKSemanticError_NoDescription != NULL);
951 SemanticError_LDKSemanticError_MultipleDescriptions = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_MultipleDescriptions", "Lorg/ldk/enums/SemanticError;");
952 CHECK(SemanticError_LDKSemanticError_MultipleDescriptions != NULL);
953 SemanticError_LDKSemanticError_NoPaymentSecret = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_NoPaymentSecret", "Lorg/ldk/enums/SemanticError;");
954 CHECK(SemanticError_LDKSemanticError_NoPaymentSecret != NULL);
955 SemanticError_LDKSemanticError_MultiplePaymentSecrets = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_MultiplePaymentSecrets", "Lorg/ldk/enums/SemanticError;");
956 CHECK(SemanticError_LDKSemanticError_MultiplePaymentSecrets != NULL);
957 SemanticError_LDKSemanticError_InvalidFeatures = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_InvalidFeatures", "Lorg/ldk/enums/SemanticError;");
958 CHECK(SemanticError_LDKSemanticError_InvalidFeatures != NULL);
959 SemanticError_LDKSemanticError_InvalidRecoveryId = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_InvalidRecoveryId", "Lorg/ldk/enums/SemanticError;");
960 CHECK(SemanticError_LDKSemanticError_InvalidRecoveryId != NULL);
961 SemanticError_LDKSemanticError_InvalidSignature = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_InvalidSignature", "Lorg/ldk/enums/SemanticError;");
962 CHECK(SemanticError_LDKSemanticError_InvalidSignature != NULL);
963 SemanticError_LDKSemanticError_ImpreciseAmount = (*env)->GetStaticFieldID(env, SemanticError_class, "LDKSemanticError_ImpreciseAmount", "Lorg/ldk/enums/SemanticError;");
964 CHECK(SemanticError_LDKSemanticError_ImpreciseAmount != NULL);
966 static inline jclass LDKSemanticError_to_java(JNIEnv *env, LDKSemanticError val) {
968 case LDKSemanticError_NoPaymentHash:
969 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_NoPaymentHash);
970 case LDKSemanticError_MultiplePaymentHashes:
971 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_MultiplePaymentHashes);
972 case LDKSemanticError_NoDescription:
973 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_NoDescription);
974 case LDKSemanticError_MultipleDescriptions:
975 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_MultipleDescriptions);
976 case LDKSemanticError_NoPaymentSecret:
977 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_NoPaymentSecret);
978 case LDKSemanticError_MultiplePaymentSecrets:
979 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_MultiplePaymentSecrets);
980 case LDKSemanticError_InvalidFeatures:
981 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_InvalidFeatures);
982 case LDKSemanticError_InvalidRecoveryId:
983 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_InvalidRecoveryId);
984 case LDKSemanticError_InvalidSignature:
985 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_InvalidSignature);
986 case LDKSemanticError_ImpreciseAmount:
987 return (*env)->GetStaticObjectField(env, SemanticError_class, SemanticError_LDKSemanticError_ImpreciseAmount);
992 static inline LDKSiPrefix LDKSiPrefix_from_java(JNIEnv *env, jclass clz) {
993 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
994 if (UNLIKELY((*env)->ExceptionCheck(env))) {
995 (*env)->ExceptionDescribe(env);
996 (*env)->FatalError(env, "A call to SiPrefix.ordinal() from rust threw an exception.");
999 case 0: return LDKSiPrefix_Milli;
1000 case 1: return LDKSiPrefix_Micro;
1001 case 2: return LDKSiPrefix_Nano;
1002 case 3: return LDKSiPrefix_Pico;
1004 (*env)->FatalError(env, "A call to SiPrefix.ordinal() from rust returned an invalid value.");
1005 abort(); // Unreachable, but will let the compiler know we don't return here
1007 static jclass SiPrefix_class = NULL;
1008 static jfieldID SiPrefix_LDKSiPrefix_Milli = NULL;
1009 static jfieldID SiPrefix_LDKSiPrefix_Micro = NULL;
1010 static jfieldID SiPrefix_LDKSiPrefix_Nano = NULL;
1011 static jfieldID SiPrefix_LDKSiPrefix_Pico = NULL;
1012 JNIEXPORT void JNICALL Java_org_ldk_enums_SiPrefix_init (JNIEnv *env, jclass clz) {
1013 SiPrefix_class = (*env)->NewGlobalRef(env, clz);
1014 CHECK(SiPrefix_class != NULL);
1015 SiPrefix_LDKSiPrefix_Milli = (*env)->GetStaticFieldID(env, SiPrefix_class, "LDKSiPrefix_Milli", "Lorg/ldk/enums/SiPrefix;");
1016 CHECK(SiPrefix_LDKSiPrefix_Milli != NULL);
1017 SiPrefix_LDKSiPrefix_Micro = (*env)->GetStaticFieldID(env, SiPrefix_class, "LDKSiPrefix_Micro", "Lorg/ldk/enums/SiPrefix;");
1018 CHECK(SiPrefix_LDKSiPrefix_Micro != NULL);
1019 SiPrefix_LDKSiPrefix_Nano = (*env)->GetStaticFieldID(env, SiPrefix_class, "LDKSiPrefix_Nano", "Lorg/ldk/enums/SiPrefix;");
1020 CHECK(SiPrefix_LDKSiPrefix_Nano != NULL);
1021 SiPrefix_LDKSiPrefix_Pico = (*env)->GetStaticFieldID(env, SiPrefix_class, "LDKSiPrefix_Pico", "Lorg/ldk/enums/SiPrefix;");
1022 CHECK(SiPrefix_LDKSiPrefix_Pico != NULL);
1024 static inline jclass LDKSiPrefix_to_java(JNIEnv *env, LDKSiPrefix val) {
1026 case LDKSiPrefix_Milli:
1027 return (*env)->GetStaticObjectField(env, SiPrefix_class, SiPrefix_LDKSiPrefix_Milli);
1028 case LDKSiPrefix_Micro:
1029 return (*env)->GetStaticObjectField(env, SiPrefix_class, SiPrefix_LDKSiPrefix_Micro);
1030 case LDKSiPrefix_Nano:
1031 return (*env)->GetStaticObjectField(env, SiPrefix_class, SiPrefix_LDKSiPrefix_Nano);
1032 case LDKSiPrefix_Pico:
1033 return (*env)->GetStaticObjectField(env, SiPrefix_class, SiPrefix_LDKSiPrefix_Pico);
1038 static inline LDKUtxoLookupError LDKUtxoLookupError_from_java(JNIEnv *env, jclass clz) {
1039 jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
1040 if (UNLIKELY((*env)->ExceptionCheck(env))) {
1041 (*env)->ExceptionDescribe(env);
1042 (*env)->FatalError(env, "A call to UtxoLookupError.ordinal() from rust threw an exception.");
1045 case 0: return LDKUtxoLookupError_UnknownChain;
1046 case 1: return LDKUtxoLookupError_UnknownTx;
1048 (*env)->FatalError(env, "A call to UtxoLookupError.ordinal() from rust returned an invalid value.");
1049 abort(); // Unreachable, but will let the compiler know we don't return here
1051 static jclass UtxoLookupError_class = NULL;
1052 static jfieldID UtxoLookupError_LDKUtxoLookupError_UnknownChain = NULL;
1053 static jfieldID UtxoLookupError_LDKUtxoLookupError_UnknownTx = NULL;
1054 JNIEXPORT void JNICALL Java_org_ldk_enums_UtxoLookupError_init (JNIEnv *env, jclass clz) {
1055 UtxoLookupError_class = (*env)->NewGlobalRef(env, clz);
1056 CHECK(UtxoLookupError_class != NULL);
1057 UtxoLookupError_LDKUtxoLookupError_UnknownChain = (*env)->GetStaticFieldID(env, UtxoLookupError_class, "LDKUtxoLookupError_UnknownChain", "Lorg/ldk/enums/UtxoLookupError;");
1058 CHECK(UtxoLookupError_LDKUtxoLookupError_UnknownChain != NULL);
1059 UtxoLookupError_LDKUtxoLookupError_UnknownTx = (*env)->GetStaticFieldID(env, UtxoLookupError_class, "LDKUtxoLookupError_UnknownTx", "Lorg/ldk/enums/UtxoLookupError;");
1060 CHECK(UtxoLookupError_LDKUtxoLookupError_UnknownTx != NULL);
1062 static inline jclass LDKUtxoLookupError_to_java(JNIEnv *env, LDKUtxoLookupError val) {
1064 case LDKUtxoLookupError_UnknownChain:
1065 return (*env)->GetStaticObjectField(env, UtxoLookupError_class, UtxoLookupError_LDKUtxoLookupError_UnknownChain);
1066 case LDKUtxoLookupError_UnknownTx:
1067 return (*env)->GetStaticObjectField(env, UtxoLookupError_class, UtxoLookupError_LDKUtxoLookupError_UnknownTx);
1072 struct LDKThirtyTwoBytes BigEndianScalar_get_bytes (struct LDKBigEndianScalar* thing) {
1073 LDKThirtyTwoBytes ret = { .data = *thing->big_endian_bytes };
1076 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BigEndianScalar_1get_1bytes(JNIEnv *env, jclass clz, int64_t thing) {
1077 LDKBigEndianScalar* thing_conv = (LDKBigEndianScalar*)untag_ptr(thing);
1078 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
1079 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BigEndianScalar_get_bytes(thing_conv).data);
1083 static void BigEndianScalar_free (struct LDKBigEndianScalar thing) {}
1084 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BigEndianScalar_1free(JNIEnv *env, jclass clz, int64_t thing) {
1085 if (!ptr_is_owned(thing)) return;
1086 void* thing_ptr = untag_ptr(thing);
1087 CHECK_ACCESS(thing_ptr);
1088 LDKBigEndianScalar thing_conv = *(LDKBigEndianScalar*)(thing_ptr);
1089 FREE(untag_ptr(thing));
1090 BigEndianScalar_free(thing_conv);
1093 static jclass LDKBech32Error_MissingSeparator_class = NULL;
1094 static jmethodID LDKBech32Error_MissingSeparator_meth = NULL;
1095 static jclass LDKBech32Error_InvalidChecksum_class = NULL;
1096 static jmethodID LDKBech32Error_InvalidChecksum_meth = NULL;
1097 static jclass LDKBech32Error_InvalidLength_class = NULL;
1098 static jmethodID LDKBech32Error_InvalidLength_meth = NULL;
1099 static jclass LDKBech32Error_InvalidChar_class = NULL;
1100 static jmethodID LDKBech32Error_InvalidChar_meth = NULL;
1101 static jclass LDKBech32Error_InvalidData_class = NULL;
1102 static jmethodID LDKBech32Error_InvalidData_meth = NULL;
1103 static jclass LDKBech32Error_InvalidPadding_class = NULL;
1104 static jmethodID LDKBech32Error_InvalidPadding_meth = NULL;
1105 static jclass LDKBech32Error_MixedCase_class = NULL;
1106 static jmethodID LDKBech32Error_MixedCase_meth = NULL;
1107 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBech32Error_init (JNIEnv *env, jclass clz) {
1108 LDKBech32Error_MissingSeparator_class =
1109 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$MissingSeparator"));
1110 CHECK(LDKBech32Error_MissingSeparator_class != NULL);
1111 LDKBech32Error_MissingSeparator_meth = (*env)->GetMethodID(env, LDKBech32Error_MissingSeparator_class, "<init>", "()V");
1112 CHECK(LDKBech32Error_MissingSeparator_meth != NULL);
1113 LDKBech32Error_InvalidChecksum_class =
1114 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidChecksum"));
1115 CHECK(LDKBech32Error_InvalidChecksum_class != NULL);
1116 LDKBech32Error_InvalidChecksum_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidChecksum_class, "<init>", "()V");
1117 CHECK(LDKBech32Error_InvalidChecksum_meth != NULL);
1118 LDKBech32Error_InvalidLength_class =
1119 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidLength"));
1120 CHECK(LDKBech32Error_InvalidLength_class != NULL);
1121 LDKBech32Error_InvalidLength_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidLength_class, "<init>", "()V");
1122 CHECK(LDKBech32Error_InvalidLength_meth != NULL);
1123 LDKBech32Error_InvalidChar_class =
1124 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidChar"));
1125 CHECK(LDKBech32Error_InvalidChar_class != NULL);
1126 LDKBech32Error_InvalidChar_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidChar_class, "<init>", "(I)V");
1127 CHECK(LDKBech32Error_InvalidChar_meth != NULL);
1128 LDKBech32Error_InvalidData_class =
1129 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidData"));
1130 CHECK(LDKBech32Error_InvalidData_class != NULL);
1131 LDKBech32Error_InvalidData_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidData_class, "<init>", "(B)V");
1132 CHECK(LDKBech32Error_InvalidData_meth != NULL);
1133 LDKBech32Error_InvalidPadding_class =
1134 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$InvalidPadding"));
1135 CHECK(LDKBech32Error_InvalidPadding_class != NULL);
1136 LDKBech32Error_InvalidPadding_meth = (*env)->GetMethodID(env, LDKBech32Error_InvalidPadding_class, "<init>", "()V");
1137 CHECK(LDKBech32Error_InvalidPadding_meth != NULL);
1138 LDKBech32Error_MixedCase_class =
1139 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBech32Error$MixedCase"));
1140 CHECK(LDKBech32Error_MixedCase_class != NULL);
1141 LDKBech32Error_MixedCase_meth = (*env)->GetMethodID(env, LDKBech32Error_MixedCase_class, "<init>", "()V");
1142 CHECK(LDKBech32Error_MixedCase_meth != NULL);
1144 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBech32Error_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1145 LDKBech32Error *obj = (LDKBech32Error*)untag_ptr(ptr);
1147 case LDKBech32Error_MissingSeparator: {
1148 return (*env)->NewObject(env, LDKBech32Error_MissingSeparator_class, LDKBech32Error_MissingSeparator_meth);
1150 case LDKBech32Error_InvalidChecksum: {
1151 return (*env)->NewObject(env, LDKBech32Error_InvalidChecksum_class, LDKBech32Error_InvalidChecksum_meth);
1153 case LDKBech32Error_InvalidLength: {
1154 return (*env)->NewObject(env, LDKBech32Error_InvalidLength_class, LDKBech32Error_InvalidLength_meth);
1156 case LDKBech32Error_InvalidChar: {
1157 int32_t invalid_char_conv = obj->invalid_char;
1158 return (*env)->NewObject(env, LDKBech32Error_InvalidChar_class, LDKBech32Error_InvalidChar_meth, invalid_char_conv);
1160 case LDKBech32Error_InvalidData: {
1161 int8_t invalid_data_conv = obj->invalid_data;
1162 return (*env)->NewObject(env, LDKBech32Error_InvalidData_class, LDKBech32Error_InvalidData_meth, invalid_data_conv);
1164 case LDKBech32Error_InvalidPadding: {
1165 return (*env)->NewObject(env, LDKBech32Error_InvalidPadding_class, LDKBech32Error_InvalidPadding_meth);
1167 case LDKBech32Error_MixedCase: {
1168 return (*env)->NewObject(env, LDKBech32Error_MixedCase_class, LDKBech32Error_MixedCase_meth);
1173 static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) {
1174 LDKCVec_u8Z ret = { .data = MALLOC(sizeof(int8_t) * orig->datalen, "LDKCVec_u8Z clone bytes"), .datalen = orig->datalen };
1175 memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen);
1178 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) {
1179 LDKTxOut* thing_conv = (LDKTxOut*)untag_ptr(thing);
1180 LDKCVec_u8Z ret_var = TxOut_get_script_pubkey(thing_conv);
1181 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
1182 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
1183 CVec_u8Z_free(ret_var);
1187 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) {
1188 LDKTxOut* thing_conv = (LDKTxOut*)untag_ptr(thing);
1189 int64_t ret_conv = TxOut_get_value(thing_conv);
1193 static jclass LDKCOption_DurationZ_Some_class = NULL;
1194 static jmethodID LDKCOption_DurationZ_Some_meth = NULL;
1195 static jclass LDKCOption_DurationZ_None_class = NULL;
1196 static jmethodID LDKCOption_DurationZ_None_meth = NULL;
1197 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1DurationZ_init (JNIEnv *env, jclass clz) {
1198 LDKCOption_DurationZ_Some_class =
1199 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_DurationZ$Some"));
1200 CHECK(LDKCOption_DurationZ_Some_class != NULL);
1201 LDKCOption_DurationZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_DurationZ_Some_class, "<init>", "(J)V");
1202 CHECK(LDKCOption_DurationZ_Some_meth != NULL);
1203 LDKCOption_DurationZ_None_class =
1204 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_DurationZ$None"));
1205 CHECK(LDKCOption_DurationZ_None_class != NULL);
1206 LDKCOption_DurationZ_None_meth = (*env)->GetMethodID(env, LDKCOption_DurationZ_None_class, "<init>", "()V");
1207 CHECK(LDKCOption_DurationZ_None_meth != NULL);
1209 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1DurationZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1210 LDKCOption_DurationZ *obj = (LDKCOption_DurationZ*)untag_ptr(ptr);
1212 case LDKCOption_DurationZ_Some: {
1213 int64_t some_conv = obj->some;
1214 return (*env)->NewObject(env, LDKCOption_DurationZ_Some_class, LDKCOption_DurationZ_Some_meth, some_conv);
1216 case LDKCOption_DurationZ_None: {
1217 return (*env)->NewObject(env, LDKCOption_DurationZ_None_class, LDKCOption_DurationZ_None_meth);
1222 static inline LDKCVec_BlindedPathZ CVec_BlindedPathZ_clone(const LDKCVec_BlindedPathZ *orig) {
1223 LDKCVec_BlindedPathZ ret = { .data = MALLOC(sizeof(LDKBlindedPath) * orig->datalen, "LDKCVec_BlindedPathZ clone bytes"), .datalen = orig->datalen };
1224 for (size_t i = 0; i < ret.datalen; i++) {
1225 ret.data[i] = BlindedPath_clone(&orig->data[i]);
1229 static jclass LDKCOption_u64Z_Some_class = NULL;
1230 static jmethodID LDKCOption_u64Z_Some_meth = NULL;
1231 static jclass LDKCOption_u64Z_None_class = NULL;
1232 static jmethodID LDKCOption_u64Z_None_meth = NULL;
1233 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u64Z_init (JNIEnv *env, jclass clz) {
1234 LDKCOption_u64Z_Some_class =
1235 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u64Z$Some"));
1236 CHECK(LDKCOption_u64Z_Some_class != NULL);
1237 LDKCOption_u64Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u64Z_Some_class, "<init>", "(J)V");
1238 CHECK(LDKCOption_u64Z_Some_meth != NULL);
1239 LDKCOption_u64Z_None_class =
1240 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u64Z$None"));
1241 CHECK(LDKCOption_u64Z_None_class != NULL);
1242 LDKCOption_u64Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u64Z_None_class, "<init>", "()V");
1243 CHECK(LDKCOption_u64Z_None_meth != NULL);
1245 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u64Z_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1246 LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr);
1248 case LDKCOption_u64Z_Some: {
1249 int64_t some_conv = obj->some;
1250 return (*env)->NewObject(env, LDKCOption_u64Z_Some_class, LDKCOption_u64Z_Some_meth, some_conv);
1252 case LDKCOption_u64Z_None: {
1253 return (*env)->NewObject(env, LDKCOption_u64Z_None_class, LDKCOption_u64Z_None_meth);
1258 static jclass LDKAPIError_APIMisuseError_class = NULL;
1259 static jmethodID LDKAPIError_APIMisuseError_meth = NULL;
1260 static jclass LDKAPIError_FeeRateTooHigh_class = NULL;
1261 static jmethodID LDKAPIError_FeeRateTooHigh_meth = NULL;
1262 static jclass LDKAPIError_InvalidRoute_class = NULL;
1263 static jmethodID LDKAPIError_InvalidRoute_meth = NULL;
1264 static jclass LDKAPIError_ChannelUnavailable_class = NULL;
1265 static jmethodID LDKAPIError_ChannelUnavailable_meth = NULL;
1266 static jclass LDKAPIError_MonitorUpdateInProgress_class = NULL;
1267 static jmethodID LDKAPIError_MonitorUpdateInProgress_meth = NULL;
1268 static jclass LDKAPIError_IncompatibleShutdownScript_class = NULL;
1269 static jmethodID LDKAPIError_IncompatibleShutdownScript_meth = NULL;
1270 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv *env, jclass clz) {
1271 LDKAPIError_APIMisuseError_class =
1272 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$APIMisuseError"));
1273 CHECK(LDKAPIError_APIMisuseError_class != NULL);
1274 LDKAPIError_APIMisuseError_meth = (*env)->GetMethodID(env, LDKAPIError_APIMisuseError_class, "<init>", "(Ljava/lang/String;)V");
1275 CHECK(LDKAPIError_APIMisuseError_meth != NULL);
1276 LDKAPIError_FeeRateTooHigh_class =
1277 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$FeeRateTooHigh"));
1278 CHECK(LDKAPIError_FeeRateTooHigh_class != NULL);
1279 LDKAPIError_FeeRateTooHigh_meth = (*env)->GetMethodID(env, LDKAPIError_FeeRateTooHigh_class, "<init>", "(Ljava/lang/String;I)V");
1280 CHECK(LDKAPIError_FeeRateTooHigh_meth != NULL);
1281 LDKAPIError_InvalidRoute_class =
1282 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$InvalidRoute"));
1283 CHECK(LDKAPIError_InvalidRoute_class != NULL);
1284 LDKAPIError_InvalidRoute_meth = (*env)->GetMethodID(env, LDKAPIError_InvalidRoute_class, "<init>", "(Ljava/lang/String;)V");
1285 CHECK(LDKAPIError_InvalidRoute_meth != NULL);
1286 LDKAPIError_ChannelUnavailable_class =
1287 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$ChannelUnavailable"));
1288 CHECK(LDKAPIError_ChannelUnavailable_class != NULL);
1289 LDKAPIError_ChannelUnavailable_meth = (*env)->GetMethodID(env, LDKAPIError_ChannelUnavailable_class, "<init>", "(Ljava/lang/String;)V");
1290 CHECK(LDKAPIError_ChannelUnavailable_meth != NULL);
1291 LDKAPIError_MonitorUpdateInProgress_class =
1292 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$MonitorUpdateInProgress"));
1293 CHECK(LDKAPIError_MonitorUpdateInProgress_class != NULL);
1294 LDKAPIError_MonitorUpdateInProgress_meth = (*env)->GetMethodID(env, LDKAPIError_MonitorUpdateInProgress_class, "<init>", "()V");
1295 CHECK(LDKAPIError_MonitorUpdateInProgress_meth != NULL);
1296 LDKAPIError_IncompatibleShutdownScript_class =
1297 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$IncompatibleShutdownScript"));
1298 CHECK(LDKAPIError_IncompatibleShutdownScript_class != NULL);
1299 LDKAPIError_IncompatibleShutdownScript_meth = (*env)->GetMethodID(env, LDKAPIError_IncompatibleShutdownScript_class, "<init>", "(J)V");
1300 CHECK(LDKAPIError_IncompatibleShutdownScript_meth != NULL);
1302 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1303 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
1305 case LDKAPIError_APIMisuseError: {
1306 LDKStr err_str = obj->api_misuse_error.err;
1307 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
1308 return (*env)->NewObject(env, LDKAPIError_APIMisuseError_class, LDKAPIError_APIMisuseError_meth, err_conv);
1310 case LDKAPIError_FeeRateTooHigh: {
1311 LDKStr err_str = obj->fee_rate_too_high.err;
1312 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
1313 int32_t feerate_conv = obj->fee_rate_too_high.feerate;
1314 return (*env)->NewObject(env, LDKAPIError_FeeRateTooHigh_class, LDKAPIError_FeeRateTooHigh_meth, err_conv, feerate_conv);
1316 case LDKAPIError_InvalidRoute: {
1317 LDKStr err_str = obj->invalid_route.err;
1318 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
1319 return (*env)->NewObject(env, LDKAPIError_InvalidRoute_class, LDKAPIError_InvalidRoute_meth, err_conv);
1321 case LDKAPIError_ChannelUnavailable: {
1322 LDKStr err_str = obj->channel_unavailable.err;
1323 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
1324 return (*env)->NewObject(env, LDKAPIError_ChannelUnavailable_class, LDKAPIError_ChannelUnavailable_meth, err_conv);
1326 case LDKAPIError_MonitorUpdateInProgress: {
1327 return (*env)->NewObject(env, LDKAPIError_MonitorUpdateInProgress_class, LDKAPIError_MonitorUpdateInProgress_meth);
1329 case LDKAPIError_IncompatibleShutdownScript: {
1330 LDKShutdownScript script_var = obj->incompatible_shutdown_script.script;
1331 int64_t script_ref = 0;
1332 CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var);
1333 script_ref = tag_ptr(script_var.inner, false);
1334 return (*env)->NewObject(env, LDKAPIError_IncompatibleShutdownScript_class, LDKAPIError_IncompatibleShutdownScript_meth, script_ref);
1339 static inline void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
1340 CHECK(owner->result_ok);
1341 return *owner->contents.result;
1343 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1344 LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
1345 CResult_NoneAPIErrorZ_get_ok(owner_conv);
1348 static inline struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
1349 CHECK(!owner->result_ok);
1350 return APIError_clone(&*owner->contents.err);
1352 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1353 LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
1354 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
1355 *ret_copy = CResult_NoneAPIErrorZ_get_err(owner_conv);
1356 int64_t ret_ref = tag_ptr(ret_copy, true);
1360 static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) {
1361 LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen };
1362 for (size_t i = 0; i < ret.datalen; i++) {
1363 ret.data[i] = CResult_NoneAPIErrorZ_clone(&orig->data[i]);
1367 static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) {
1368 LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen };
1369 for (size_t i = 0; i < ret.datalen; i++) {
1370 ret.data[i] = APIError_clone(&orig->data[i]);
1374 static jclass LDKCOption_CVec_u8ZZ_Some_class = NULL;
1375 static jmethodID LDKCOption_CVec_u8ZZ_Some_meth = NULL;
1376 static jclass LDKCOption_CVec_u8ZZ_None_class = NULL;
1377 static jmethodID LDKCOption_CVec_u8ZZ_None_meth = NULL;
1378 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CVec_1u8ZZ_init (JNIEnv *env, jclass clz) {
1379 LDKCOption_CVec_u8ZZ_Some_class =
1380 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_u8ZZ$Some"));
1381 CHECK(LDKCOption_CVec_u8ZZ_Some_class != NULL);
1382 LDKCOption_CVec_u8ZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CVec_u8ZZ_Some_class, "<init>", "([B)V");
1383 CHECK(LDKCOption_CVec_u8ZZ_Some_meth != NULL);
1384 LDKCOption_CVec_u8ZZ_None_class =
1385 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_u8ZZ$None"));
1386 CHECK(LDKCOption_CVec_u8ZZ_None_class != NULL);
1387 LDKCOption_CVec_u8ZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CVec_u8ZZ_None_class, "<init>", "()V");
1388 CHECK(LDKCOption_CVec_u8ZZ_None_meth != NULL);
1390 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1u8ZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1391 LDKCOption_CVec_u8ZZ *obj = (LDKCOption_CVec_u8ZZ*)untag_ptr(ptr);
1393 case LDKCOption_CVec_u8ZZ_Some: {
1394 LDKCVec_u8Z some_var = obj->some;
1395 int8_tArray some_arr = (*env)->NewByteArray(env, some_var.datalen);
1396 (*env)->SetByteArrayRegion(env, some_arr, 0, some_var.datalen, some_var.data);
1397 return (*env)->NewObject(env, LDKCOption_CVec_u8ZZ_Some_class, LDKCOption_CVec_u8ZZ_Some_meth, some_arr);
1399 case LDKCOption_CVec_u8ZZ_None: {
1400 return (*env)->NewObject(env, LDKCOption_CVec_u8ZZ_None_class, LDKCOption_CVec_u8ZZ_None_meth);
1405 static jclass LDKDecodeError_UnknownVersion_class = NULL;
1406 static jmethodID LDKDecodeError_UnknownVersion_meth = NULL;
1407 static jclass LDKDecodeError_UnknownRequiredFeature_class = NULL;
1408 static jmethodID LDKDecodeError_UnknownRequiredFeature_meth = NULL;
1409 static jclass LDKDecodeError_InvalidValue_class = NULL;
1410 static jmethodID LDKDecodeError_InvalidValue_meth = NULL;
1411 static jclass LDKDecodeError_ShortRead_class = NULL;
1412 static jmethodID LDKDecodeError_ShortRead_meth = NULL;
1413 static jclass LDKDecodeError_BadLengthDescriptor_class = NULL;
1414 static jmethodID LDKDecodeError_BadLengthDescriptor_meth = NULL;
1415 static jclass LDKDecodeError_Io_class = NULL;
1416 static jmethodID LDKDecodeError_Io_meth = NULL;
1417 static jclass LDKDecodeError_UnsupportedCompression_class = NULL;
1418 static jmethodID LDKDecodeError_UnsupportedCompression_meth = NULL;
1419 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDecodeError_init (JNIEnv *env, jclass clz) {
1420 LDKDecodeError_UnknownVersion_class =
1421 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$UnknownVersion"));
1422 CHECK(LDKDecodeError_UnknownVersion_class != NULL);
1423 LDKDecodeError_UnknownVersion_meth = (*env)->GetMethodID(env, LDKDecodeError_UnknownVersion_class, "<init>", "()V");
1424 CHECK(LDKDecodeError_UnknownVersion_meth != NULL);
1425 LDKDecodeError_UnknownRequiredFeature_class =
1426 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$UnknownRequiredFeature"));
1427 CHECK(LDKDecodeError_UnknownRequiredFeature_class != NULL);
1428 LDKDecodeError_UnknownRequiredFeature_meth = (*env)->GetMethodID(env, LDKDecodeError_UnknownRequiredFeature_class, "<init>", "()V");
1429 CHECK(LDKDecodeError_UnknownRequiredFeature_meth != NULL);
1430 LDKDecodeError_InvalidValue_class =
1431 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$InvalidValue"));
1432 CHECK(LDKDecodeError_InvalidValue_class != NULL);
1433 LDKDecodeError_InvalidValue_meth = (*env)->GetMethodID(env, LDKDecodeError_InvalidValue_class, "<init>", "()V");
1434 CHECK(LDKDecodeError_InvalidValue_meth != NULL);
1435 LDKDecodeError_ShortRead_class =
1436 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$ShortRead"));
1437 CHECK(LDKDecodeError_ShortRead_class != NULL);
1438 LDKDecodeError_ShortRead_meth = (*env)->GetMethodID(env, LDKDecodeError_ShortRead_class, "<init>", "()V");
1439 CHECK(LDKDecodeError_ShortRead_meth != NULL);
1440 LDKDecodeError_BadLengthDescriptor_class =
1441 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$BadLengthDescriptor"));
1442 CHECK(LDKDecodeError_BadLengthDescriptor_class != NULL);
1443 LDKDecodeError_BadLengthDescriptor_meth = (*env)->GetMethodID(env, LDKDecodeError_BadLengthDescriptor_class, "<init>", "()V");
1444 CHECK(LDKDecodeError_BadLengthDescriptor_meth != NULL);
1445 LDKDecodeError_Io_class =
1446 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$Io"));
1447 CHECK(LDKDecodeError_Io_class != NULL);
1448 LDKDecodeError_Io_meth = (*env)->GetMethodID(env, LDKDecodeError_Io_class, "<init>", "(Lorg/ldk/enums/IOError;)V");
1449 CHECK(LDKDecodeError_Io_meth != NULL);
1450 LDKDecodeError_UnsupportedCompression_class =
1451 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$UnsupportedCompression"));
1452 CHECK(LDKDecodeError_UnsupportedCompression_class != NULL);
1453 LDKDecodeError_UnsupportedCompression_meth = (*env)->GetMethodID(env, LDKDecodeError_UnsupportedCompression_class, "<init>", "()V");
1454 CHECK(LDKDecodeError_UnsupportedCompression_meth != NULL);
1456 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDecodeError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1457 LDKDecodeError *obj = (LDKDecodeError*)untag_ptr(ptr);
1459 case LDKDecodeError_UnknownVersion: {
1460 return (*env)->NewObject(env, LDKDecodeError_UnknownVersion_class, LDKDecodeError_UnknownVersion_meth);
1462 case LDKDecodeError_UnknownRequiredFeature: {
1463 return (*env)->NewObject(env, LDKDecodeError_UnknownRequiredFeature_class, LDKDecodeError_UnknownRequiredFeature_meth);
1465 case LDKDecodeError_InvalidValue: {
1466 return (*env)->NewObject(env, LDKDecodeError_InvalidValue_class, LDKDecodeError_InvalidValue_meth);
1468 case LDKDecodeError_ShortRead: {
1469 return (*env)->NewObject(env, LDKDecodeError_ShortRead_class, LDKDecodeError_ShortRead_meth);
1471 case LDKDecodeError_BadLengthDescriptor: {
1472 return (*env)->NewObject(env, LDKDecodeError_BadLengthDescriptor_class, LDKDecodeError_BadLengthDescriptor_meth);
1474 case LDKDecodeError_Io: {
1475 jclass io_conv = LDKIOError_to_java(env, obj->io);
1476 return (*env)->NewObject(env, LDKDecodeError_Io_class, LDKDecodeError_Io_meth, io_conv);
1478 case LDKDecodeError_UnsupportedCompression: {
1479 return (*env)->NewObject(env, LDKDecodeError_UnsupportedCompression_class, LDKDecodeError_UnsupportedCompression_meth);
1484 static inline struct LDKRecipientOnionFields CResult_RecipientOnionFieldsDecodeErrorZ_get_ok(LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR owner){
1485 LDKRecipientOnionFields ret = *owner->contents.result;
1486 ret.is_owned = false;
1489 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1490 LDKCResult_RecipientOnionFieldsDecodeErrorZ* owner_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(owner);
1491 LDKRecipientOnionFields ret_var = CResult_RecipientOnionFieldsDecodeErrorZ_get_ok(owner_conv);
1492 int64_t ret_ref = 0;
1493 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1494 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1498 static inline struct LDKDecodeError CResult_RecipientOnionFieldsDecodeErrorZ_get_err(LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR owner){
1499 CHECK(!owner->result_ok);
1500 return DecodeError_clone(&*owner->contents.err);
1502 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1503 LDKCResult_RecipientOnionFieldsDecodeErrorZ* owner_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(owner);
1504 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1505 *ret_copy = CResult_RecipientOnionFieldsDecodeErrorZ_get_err(owner_conv);
1506 int64_t ret_ref = tag_ptr(ret_copy, true);
1510 static jclass LDKCOption_HTLCClaimZ_Some_class = NULL;
1511 static jmethodID LDKCOption_HTLCClaimZ_Some_meth = NULL;
1512 static jclass LDKCOption_HTLCClaimZ_None_class = NULL;
1513 static jmethodID LDKCOption_HTLCClaimZ_None_meth = NULL;
1514 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1HTLCClaimZ_init (JNIEnv *env, jclass clz) {
1515 LDKCOption_HTLCClaimZ_Some_class =
1516 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_HTLCClaimZ$Some"));
1517 CHECK(LDKCOption_HTLCClaimZ_Some_class != NULL);
1518 LDKCOption_HTLCClaimZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_HTLCClaimZ_Some_class, "<init>", "(Lorg/ldk/enums/HTLCClaim;)V");
1519 CHECK(LDKCOption_HTLCClaimZ_Some_meth != NULL);
1520 LDKCOption_HTLCClaimZ_None_class =
1521 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_HTLCClaimZ$None"));
1522 CHECK(LDKCOption_HTLCClaimZ_None_class != NULL);
1523 LDKCOption_HTLCClaimZ_None_meth = (*env)->GetMethodID(env, LDKCOption_HTLCClaimZ_None_class, "<init>", "()V");
1524 CHECK(LDKCOption_HTLCClaimZ_None_meth != NULL);
1526 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1HTLCClaimZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1527 LDKCOption_HTLCClaimZ *obj = (LDKCOption_HTLCClaimZ*)untag_ptr(ptr);
1529 case LDKCOption_HTLCClaimZ_Some: {
1530 jclass some_conv = LDKHTLCClaim_to_java(env, obj->some);
1531 return (*env)->NewObject(env, LDKCOption_HTLCClaimZ_Some_class, LDKCOption_HTLCClaimZ_Some_meth, some_conv);
1533 case LDKCOption_HTLCClaimZ_None: {
1534 return (*env)->NewObject(env, LDKCOption_HTLCClaimZ_None_class, LDKCOption_HTLCClaimZ_None_meth);
1539 static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){
1540 CHECK(owner->result_ok);
1541 return *owner->contents.result;
1543 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1544 LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner);
1545 CResult_NoneNoneZ_get_ok(owner_conv);
1548 static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){
1549 CHECK(!owner->result_ok);
1550 return *owner->contents.err;
1552 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1553 LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner);
1554 CResult_NoneNoneZ_get_err(owner_conv);
1557 static inline struct LDKCounterpartyCommitmentSecrets CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
1558 LDKCounterpartyCommitmentSecrets ret = *owner->contents.result;
1559 ret.is_owned = false;
1562 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1563 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
1564 LDKCounterpartyCommitmentSecrets ret_var = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(owner_conv);
1565 int64_t ret_ref = 0;
1566 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1567 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1571 static inline struct LDKDecodeError CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
1572 CHECK(!owner->result_ok);
1573 return DecodeError_clone(&*owner->contents.err);
1575 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1576 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
1577 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1578 *ret_copy = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(owner_conv);
1579 int64_t ret_ref = tag_ptr(ret_copy, true);
1583 static inline struct LDKTxCreationKeys CResult_TxCreationKeysDecodeErrorZ_get_ok(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
1584 LDKTxCreationKeys ret = *owner->contents.result;
1585 ret.is_owned = false;
1588 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1589 LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
1590 LDKTxCreationKeys ret_var = CResult_TxCreationKeysDecodeErrorZ_get_ok(owner_conv);
1591 int64_t ret_ref = 0;
1592 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1593 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1597 static inline struct LDKDecodeError CResult_TxCreationKeysDecodeErrorZ_get_err(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
1598 CHECK(!owner->result_ok);
1599 return DecodeError_clone(&*owner->contents.err);
1601 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1602 LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
1603 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1604 *ret_copy = CResult_TxCreationKeysDecodeErrorZ_get_err(owner_conv);
1605 int64_t ret_ref = tag_ptr(ret_copy, true);
1609 static inline struct LDKChannelPublicKeys CResult_ChannelPublicKeysDecodeErrorZ_get_ok(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
1610 LDKChannelPublicKeys ret = *owner->contents.result;
1611 ret.is_owned = false;
1614 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1615 LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
1616 LDKChannelPublicKeys ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_ok(owner_conv);
1617 int64_t ret_ref = 0;
1618 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1619 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1623 static inline struct LDKDecodeError CResult_ChannelPublicKeysDecodeErrorZ_get_err(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
1624 CHECK(!owner->result_ok);
1625 return DecodeError_clone(&*owner->contents.err);
1627 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1628 LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
1629 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1630 *ret_copy = CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner_conv);
1631 int64_t ret_ref = tag_ptr(ret_copy, true);
1635 static jclass LDKCOption_u32Z_Some_class = NULL;
1636 static jmethodID LDKCOption_u32Z_Some_meth = NULL;
1637 static jclass LDKCOption_u32Z_None_class = NULL;
1638 static jmethodID LDKCOption_u32Z_None_meth = NULL;
1639 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u32Z_init (JNIEnv *env, jclass clz) {
1640 LDKCOption_u32Z_Some_class =
1641 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u32Z$Some"));
1642 CHECK(LDKCOption_u32Z_Some_class != NULL);
1643 LDKCOption_u32Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u32Z_Some_class, "<init>", "(I)V");
1644 CHECK(LDKCOption_u32Z_Some_meth != NULL);
1645 LDKCOption_u32Z_None_class =
1646 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u32Z$None"));
1647 CHECK(LDKCOption_u32Z_None_class != NULL);
1648 LDKCOption_u32Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u32Z_None_class, "<init>", "()V");
1649 CHECK(LDKCOption_u32Z_None_meth != NULL);
1651 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u32Z_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
1652 LDKCOption_u32Z *obj = (LDKCOption_u32Z*)untag_ptr(ptr);
1654 case LDKCOption_u32Z_Some: {
1655 int32_t some_conv = obj->some;
1656 return (*env)->NewObject(env, LDKCOption_u32Z_Some_class, LDKCOption_u32Z_Some_meth, some_conv);
1658 case LDKCOption_u32Z_None: {
1659 return (*env)->NewObject(env, LDKCOption_u32Z_None_class, LDKCOption_u32Z_None_meth);
1664 static inline struct LDKHTLCOutputInCommitment CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
1665 LDKHTLCOutputInCommitment ret = *owner->contents.result;
1666 ret.is_owned = false;
1669 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1670 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
1671 LDKHTLCOutputInCommitment ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(owner_conv);
1672 int64_t ret_ref = 0;
1673 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1674 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1678 static inline struct LDKDecodeError CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
1679 CHECK(!owner->result_ok);
1680 return DecodeError_clone(&*owner->contents.err);
1682 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1683 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
1684 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1685 *ret_copy = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner_conv);
1686 int64_t ret_ref = tag_ptr(ret_copy, true);
1690 static inline struct LDKCounterpartyChannelTransactionParameters CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
1691 LDKCounterpartyChannelTransactionParameters ret = *owner->contents.result;
1692 ret.is_owned = false;
1695 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1696 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
1697 LDKCounterpartyChannelTransactionParameters ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv);
1698 int64_t ret_ref = 0;
1699 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1700 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1704 static inline struct LDKDecodeError CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
1705 CHECK(!owner->result_ok);
1706 return DecodeError_clone(&*owner->contents.err);
1708 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1709 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
1710 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1711 *ret_copy = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
1712 int64_t ret_ref = tag_ptr(ret_copy, true);
1716 static inline struct LDKChannelTransactionParameters CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
1717 LDKChannelTransactionParameters ret = *owner->contents.result;
1718 ret.is_owned = false;
1721 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1722 LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
1723 LDKChannelTransactionParameters ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv);
1724 int64_t ret_ref = 0;
1725 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1726 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1730 static inline struct LDKDecodeError CResult_ChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
1731 CHECK(!owner->result_ok);
1732 return DecodeError_clone(&*owner->contents.err);
1734 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1735 LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
1736 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1737 *ret_copy = CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
1738 int64_t ret_ref = tag_ptr(ret_copy, true);
1742 static inline struct LDKHolderCommitmentTransaction CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1743 LDKHolderCommitmentTransaction ret = *owner->contents.result;
1744 ret.is_owned = false;
1747 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1748 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1749 LDKHolderCommitmentTransaction ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
1750 int64_t ret_ref = 0;
1751 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1752 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1756 static inline struct LDKDecodeError CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1757 CHECK(!owner->result_ok);
1758 return DecodeError_clone(&*owner->contents.err);
1760 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1761 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1762 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1763 *ret_copy = CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
1764 int64_t ret_ref = tag_ptr(ret_copy, true);
1768 static inline struct LDKBuiltCommitmentTransaction CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1769 LDKBuiltCommitmentTransaction ret = *owner->contents.result;
1770 ret.is_owned = false;
1773 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1774 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1775 LDKBuiltCommitmentTransaction ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
1776 int64_t ret_ref = 0;
1777 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1778 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1782 static inline struct LDKDecodeError CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1783 CHECK(!owner->result_ok);
1784 return DecodeError_clone(&*owner->contents.err);
1786 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1787 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1788 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1789 *ret_copy = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
1790 int64_t ret_ref = tag_ptr(ret_copy, true);
1794 static inline struct LDKTrustedClosingTransaction CResult_TrustedClosingTransactionNoneZ_get_ok(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner){
1795 LDKTrustedClosingTransaction ret = *owner->contents.result;
1796 ret.is_owned = false;
1799 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1800 LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(owner);
1801 LDKTrustedClosingTransaction ret_var = CResult_TrustedClosingTransactionNoneZ_get_ok(owner_conv);
1802 int64_t ret_ref = 0;
1803 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1804 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1808 static inline void CResult_TrustedClosingTransactionNoneZ_get_err(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner){
1809 CHECK(!owner->result_ok);
1810 return *owner->contents.err;
1812 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1813 LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(owner);
1814 CResult_TrustedClosingTransactionNoneZ_get_err(owner_conv);
1817 static inline struct LDKCommitmentTransaction CResult_CommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1818 LDKCommitmentTransaction ret = *owner->contents.result;
1819 ret.is_owned = false;
1822 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1823 LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1824 LDKCommitmentTransaction ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
1825 int64_t ret_ref = 0;
1826 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1827 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1831 static inline struct LDKDecodeError CResult_CommitmentTransactionDecodeErrorZ_get_err(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
1832 CHECK(!owner->result_ok);
1833 return DecodeError_clone(&*owner->contents.err);
1835 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1836 LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
1837 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1838 *ret_copy = CResult_CommitmentTransactionDecodeErrorZ_get_err(owner_conv);
1839 int64_t ret_ref = tag_ptr(ret_copy, true);
1843 static inline struct LDKTrustedCommitmentTransaction CResult_TrustedCommitmentTransactionNoneZ_get_ok(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner){
1844 LDKTrustedCommitmentTransaction ret = *owner->contents.result;
1845 ret.is_owned = false;
1848 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1849 LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(owner);
1850 LDKTrustedCommitmentTransaction ret_var = CResult_TrustedCommitmentTransactionNoneZ_get_ok(owner_conv);
1851 int64_t ret_ref = 0;
1852 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1853 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1857 static inline void CResult_TrustedCommitmentTransactionNoneZ_get_err(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner){
1858 CHECK(!owner->result_ok);
1859 return *owner->contents.err;
1861 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1862 LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(owner);
1863 CResult_TrustedCommitmentTransactionNoneZ_get_err(owner_conv);
1866 static inline struct LDKCVec_SignatureZ CResult_CVec_SignatureZNoneZ_get_ok(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner){
1867 CHECK(owner->result_ok);
1868 return *owner->contents.result;
1870 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1871 LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(owner);
1872 LDKCVec_SignatureZ ret_var = CResult_CVec_SignatureZNoneZ_get_ok(owner_conv);
1873 jobjectArray ret_arr = NULL;
1874 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
1876 for (size_t i = 0; i < ret_var.datalen; i++) {
1877 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64);
1878 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form);
1879 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
1885 static inline void CResult_CVec_SignatureZNoneZ_get_err(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner){
1886 CHECK(!owner->result_ok);
1887 return *owner->contents.err;
1889 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1890 LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(owner);
1891 CResult_CVec_SignatureZNoneZ_get_err(owner_conv);
1894 static inline struct LDKShutdownScript CResult_ShutdownScriptDecodeErrorZ_get_ok(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
1895 LDKShutdownScript ret = *owner->contents.result;
1896 ret.is_owned = false;
1899 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1900 LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
1901 LDKShutdownScript ret_var = CResult_ShutdownScriptDecodeErrorZ_get_ok(owner_conv);
1902 int64_t ret_ref = 0;
1903 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1904 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1908 static inline struct LDKDecodeError CResult_ShutdownScriptDecodeErrorZ_get_err(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
1909 CHECK(!owner->result_ok);
1910 return DecodeError_clone(&*owner->contents.err);
1912 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1913 LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
1914 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1915 *ret_copy = CResult_ShutdownScriptDecodeErrorZ_get_err(owner_conv);
1916 int64_t ret_ref = tag_ptr(ret_copy, true);
1920 static inline struct LDKShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner){
1921 LDKShutdownScript ret = *owner->contents.result;
1922 ret.is_owned = false;
1925 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1926 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(owner);
1927 LDKShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(owner_conv);
1928 int64_t ret_ref = 0;
1929 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1930 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1934 static inline struct LDKInvalidShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner){
1935 LDKInvalidShutdownScript ret = *owner->contents.err;
1936 ret.is_owned = false;
1939 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1940 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(owner);
1941 LDKInvalidShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(owner_conv);
1942 int64_t ret_ref = 0;
1943 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1944 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1948 static inline struct LDKBlindedPayInfo CResult_BlindedPayInfoDecodeErrorZ_get_ok(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner){
1949 LDKBlindedPayInfo ret = *owner->contents.result;
1950 ret.is_owned = false;
1953 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
1954 LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner);
1955 LDKBlindedPayInfo ret_var = CResult_BlindedPayInfoDecodeErrorZ_get_ok(owner_conv);
1956 int64_t ret_ref = 0;
1957 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1958 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1962 static inline struct LDKDecodeError CResult_BlindedPayInfoDecodeErrorZ_get_err(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR owner){
1963 CHECK(!owner->result_ok);
1964 return DecodeError_clone(&*owner->contents.err);
1966 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
1967 LDKCResult_BlindedPayInfoDecodeErrorZ* owner_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(owner);
1968 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
1969 *ret_copy = CResult_BlindedPayInfoDecodeErrorZ_get_err(owner_conv);
1970 int64_t ret_ref = tag_ptr(ret_copy, true);
1974 typedef struct LDKScore_JCalls {
1975 atomic_size_t refcnt;
1978 jmethodID channel_penalty_msat_meth;
1979 jmethodID payment_path_failed_meth;
1980 jmethodID payment_path_successful_meth;
1981 jmethodID probe_failed_meth;
1982 jmethodID probe_successful_meth;
1983 jmethodID write_meth;
1985 static void LDKScore_JCalls_free(void* this_arg) {
1986 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
1987 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1989 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
1990 if (get_jenv_res == JNI_EDETACHED) {
1991 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
1993 DO_ASSERT(get_jenv_res == JNI_OK);
1995 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
1996 if (get_jenv_res == JNI_EDETACHED) {
1997 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2002 uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target, LDKChannelUsage usage) {
2003 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
2005 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2006 if (get_jenv_res == JNI_EDETACHED) {
2007 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2009 DO_ASSERT(get_jenv_res == JNI_OK);
2011 int64_t short_channel_id_conv = short_channel_id;
2012 LDKNodeId source_var = *source;
2013 int64_t source_ref = 0;
2014 source_var = NodeId_clone(&source_var);
2015 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var);
2016 source_ref = tag_ptr(source_var.inner, source_var.is_owned);
2017 LDKNodeId target_var = *target;
2018 int64_t target_ref = 0;
2019 target_var = NodeId_clone(&target_var);
2020 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var);
2021 target_ref = tag_ptr(target_var.inner, target_var.is_owned);
2022 LDKChannelUsage usage_var = usage;
2023 int64_t usage_ref = 0;
2024 CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_var);
2025 usage_ref = tag_ptr(usage_var.inner, usage_var.is_owned);
2026 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
2028 int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->channel_penalty_msat_meth, short_channel_id_conv, source_ref, target_ref, usage_ref);
2029 if (UNLIKELY((*env)->ExceptionCheck(env))) {
2030 (*env)->ExceptionDescribe(env);
2031 (*env)->FatalError(env, "A call to channel_penalty_msat in LDKScore from rust threw an exception.");
2033 if (get_jenv_res == JNI_EDETACHED) {
2034 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2038 void payment_path_failed_LDKScore_jcall(void* this_arg, const LDKPath * path, uint64_t short_channel_id) {
2039 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
2041 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2042 if (get_jenv_res == JNI_EDETACHED) {
2043 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2045 DO_ASSERT(get_jenv_res == JNI_OK);
2047 LDKPath path_var = *path;
2048 int64_t path_ref = 0;
2049 path_var = Path_clone(&path_var);
2050 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var);
2051 path_ref = tag_ptr(path_var.inner, path_var.is_owned);
2052 int64_t short_channel_id_conv = short_channel_id;
2053 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
2055 (*env)->CallVoidMethod(env, obj, j_calls->payment_path_failed_meth, path_ref, short_channel_id_conv);
2056 if (UNLIKELY((*env)->ExceptionCheck(env))) {
2057 (*env)->ExceptionDescribe(env);
2058 (*env)->FatalError(env, "A call to payment_path_failed in LDKScore from rust threw an exception.");
2060 if (get_jenv_res == JNI_EDETACHED) {
2061 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2064 void payment_path_successful_LDKScore_jcall(void* this_arg, const LDKPath * path) {
2065 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
2067 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2068 if (get_jenv_res == JNI_EDETACHED) {
2069 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2071 DO_ASSERT(get_jenv_res == JNI_OK);
2073 LDKPath path_var = *path;
2074 int64_t path_ref = 0;
2075 path_var = Path_clone(&path_var);
2076 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var);
2077 path_ref = tag_ptr(path_var.inner, path_var.is_owned);
2078 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
2080 (*env)->CallVoidMethod(env, obj, j_calls->payment_path_successful_meth, path_ref);
2081 if (UNLIKELY((*env)->ExceptionCheck(env))) {
2082 (*env)->ExceptionDescribe(env);
2083 (*env)->FatalError(env, "A call to payment_path_successful in LDKScore from rust threw an exception.");
2085 if (get_jenv_res == JNI_EDETACHED) {
2086 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2089 void probe_failed_LDKScore_jcall(void* this_arg, const LDKPath * path, uint64_t short_channel_id) {
2090 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
2092 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2093 if (get_jenv_res == JNI_EDETACHED) {
2094 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2096 DO_ASSERT(get_jenv_res == JNI_OK);
2098 LDKPath path_var = *path;
2099 int64_t path_ref = 0;
2100 path_var = Path_clone(&path_var);
2101 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var);
2102 path_ref = tag_ptr(path_var.inner, path_var.is_owned);
2103 int64_t short_channel_id_conv = short_channel_id;
2104 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
2106 (*env)->CallVoidMethod(env, obj, j_calls->probe_failed_meth, path_ref, short_channel_id_conv);
2107 if (UNLIKELY((*env)->ExceptionCheck(env))) {
2108 (*env)->ExceptionDescribe(env);
2109 (*env)->FatalError(env, "A call to probe_failed in LDKScore from rust threw an exception.");
2111 if (get_jenv_res == JNI_EDETACHED) {
2112 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2115 void probe_successful_LDKScore_jcall(void* this_arg, const LDKPath * path) {
2116 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
2118 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2119 if (get_jenv_res == JNI_EDETACHED) {
2120 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2122 DO_ASSERT(get_jenv_res == JNI_OK);
2124 LDKPath path_var = *path;
2125 int64_t path_ref = 0;
2126 path_var = Path_clone(&path_var);
2127 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var);
2128 path_ref = tag_ptr(path_var.inner, path_var.is_owned);
2129 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
2131 (*env)->CallVoidMethod(env, obj, j_calls->probe_successful_meth, path_ref);
2132 if (UNLIKELY((*env)->ExceptionCheck(env))) {
2133 (*env)->ExceptionDescribe(env);
2134 (*env)->FatalError(env, "A call to probe_successful in LDKScore from rust threw an exception.");
2136 if (get_jenv_res == JNI_EDETACHED) {
2137 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2140 LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) {
2141 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
2143 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2144 if (get_jenv_res == JNI_EDETACHED) {
2145 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2147 DO_ASSERT(get_jenv_res == JNI_OK);
2149 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
2151 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
2152 if (UNLIKELY((*env)->ExceptionCheck(env))) {
2153 (*env)->ExceptionDescribe(env);
2154 (*env)->FatalError(env, "A call to write in LDKScore from rust threw an exception.");
2156 LDKCVec_u8Z ret_ref;
2157 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
2158 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
2159 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
2160 if (get_jenv_res == JNI_EDETACHED) {
2161 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2165 static void LDKScore_JCalls_cloned(LDKScore* new_obj) {
2166 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) new_obj->this_arg;
2167 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2169 static inline LDKScore LDKScore_init (JNIEnv *env, jclass clz, jobject o) {
2170 jclass c = (*env)->GetObjectClass(env, o);
2172 LDKScore_JCalls *calls = MALLOC(sizeof(LDKScore_JCalls), "LDKScore_JCalls");
2173 atomic_init(&calls->refcnt, 1);
2174 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
2175 calls->o = (*env)->NewWeakGlobalRef(env, o);
2176 calls->channel_penalty_msat_meth = (*env)->GetMethodID(env, c, "channel_penalty_msat", "(JJJJ)J");
2177 CHECK(calls->channel_penalty_msat_meth != NULL);
2178 calls->payment_path_failed_meth = (*env)->GetMethodID(env, c, "payment_path_failed", "(JJ)V");
2179 CHECK(calls->payment_path_failed_meth != NULL);
2180 calls->payment_path_successful_meth = (*env)->GetMethodID(env, c, "payment_path_successful", "(J)V");
2181 CHECK(calls->payment_path_successful_meth != NULL);
2182 calls->probe_failed_meth = (*env)->GetMethodID(env, c, "probe_failed", "(JJ)V");
2183 CHECK(calls->probe_failed_meth != NULL);
2184 calls->probe_successful_meth = (*env)->GetMethodID(env, c, "probe_successful", "(J)V");
2185 CHECK(calls->probe_successful_meth != NULL);
2186 calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
2187 CHECK(calls->write_meth != NULL);
2190 .this_arg = (void*) calls,
2191 .channel_penalty_msat = channel_penalty_msat_LDKScore_jcall,
2192 .payment_path_failed = payment_path_failed_LDKScore_jcall,
2193 .payment_path_successful = payment_path_successful_LDKScore_jcall,
2194 .probe_failed = probe_failed_LDKScore_jcall,
2195 .probe_successful = probe_successful_LDKScore_jcall,
2196 .write = write_LDKScore_jcall,
2197 .free = LDKScore_JCalls_free,
2201 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKScore_1new(JNIEnv *env, jclass clz, jobject o) {
2202 LDKScore *res_ptr = MALLOC(sizeof(LDKScore), "LDKScore");
2203 *res_ptr = LDKScore_init(env, clz, o);
2204 return tag_ptr(res_ptr, true);
2206 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) {
2207 void* this_arg_ptr = untag_ptr(this_arg);
2208 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2209 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
2210 LDKNodeId source_conv;
2211 source_conv.inner = untag_ptr(source);
2212 source_conv.is_owned = ptr_is_owned(source);
2213 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv);
2214 source_conv.is_owned = false;
2215 LDKNodeId target_conv;
2216 target_conv.inner = untag_ptr(target);
2217 target_conv.is_owned = ptr_is_owned(target);
2218 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
2219 target_conv.is_owned = false;
2220 LDKChannelUsage usage_conv;
2221 usage_conv.inner = untag_ptr(usage);
2222 usage_conv.is_owned = ptr_is_owned(usage);
2223 CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_conv);
2224 usage_conv = ChannelUsage_clone(&usage_conv);
2225 int64_t ret_conv = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv, usage_conv);
2229 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path, int64_t short_channel_id) {
2230 void* this_arg_ptr = untag_ptr(this_arg);
2231 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2232 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
2234 path_conv.inner = untag_ptr(path);
2235 path_conv.is_owned = ptr_is_owned(path);
2236 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv);
2237 path_conv.is_owned = false;
2238 (this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, &path_conv, short_channel_id);
2241 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1payment_1path_1successful(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path) {
2242 void* this_arg_ptr = untag_ptr(this_arg);
2243 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2244 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
2246 path_conv.inner = untag_ptr(path);
2247 path_conv.is_owned = ptr_is_owned(path);
2248 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv);
2249 path_conv.is_owned = false;
2250 (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, &path_conv);
2253 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1probe_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path, int64_t short_channel_id) {
2254 void* this_arg_ptr = untag_ptr(this_arg);
2255 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2256 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
2258 path_conv.inner = untag_ptr(path);
2259 path_conv.is_owned = ptr_is_owned(path);
2260 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv);
2261 path_conv.is_owned = false;
2262 (this_arg_conv->probe_failed)(this_arg_conv->this_arg, &path_conv, short_channel_id);
2265 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1probe_1successful(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path) {
2266 void* this_arg_ptr = untag_ptr(this_arg);
2267 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2268 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
2270 path_conv.inner = untag_ptr(path);
2271 path_conv.is_owned = ptr_is_owned(path);
2272 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv);
2273 path_conv.is_owned = false;
2274 (this_arg_conv->probe_successful)(this_arg_conv->this_arg, &path_conv);
2277 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Score_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
2278 void* this_arg_ptr = untag_ptr(this_arg);
2279 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2280 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
2281 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
2282 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
2283 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
2284 CVec_u8Z_free(ret_var);
2288 typedef struct LDKLockableScore_JCalls {
2289 atomic_size_t refcnt;
2292 jmethodID lock_meth;
2293 } LDKLockableScore_JCalls;
2294 static void LDKLockableScore_JCalls_free(void* this_arg) {
2295 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
2296 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2298 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2299 if (get_jenv_res == JNI_EDETACHED) {
2300 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2302 DO_ASSERT(get_jenv_res == JNI_OK);
2304 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
2305 if (get_jenv_res == JNI_EDETACHED) {
2306 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2311 LDKScore lock_LDKLockableScore_jcall(const void* this_arg) {
2312 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
2314 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2315 if (get_jenv_res == JNI_EDETACHED) {
2316 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2318 DO_ASSERT(get_jenv_res == JNI_OK);
2320 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
2322 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->lock_meth);
2323 if (UNLIKELY((*env)->ExceptionCheck(env))) {
2324 (*env)->ExceptionDescribe(env);
2325 (*env)->FatalError(env, "A call to lock in LDKLockableScore from rust threw an exception.");
2327 void* ret_ptr = untag_ptr(ret);
2328 CHECK_ACCESS(ret_ptr);
2329 LDKScore ret_conv = *(LDKScore*)(ret_ptr);
2330 if (ret_conv.free == LDKScore_JCalls_free) {
2331 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2332 LDKScore_JCalls_cloned(&ret_conv);
2333 }// WARNING: we may need a move here but no clone is available for LDKScore
2335 if (get_jenv_res == JNI_EDETACHED) {
2336 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2340 static void LDKLockableScore_JCalls_cloned(LDKLockableScore* new_obj) {
2341 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) new_obj->this_arg;
2342 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2344 static inline LDKLockableScore LDKLockableScore_init (JNIEnv *env, jclass clz, jobject o) {
2345 jclass c = (*env)->GetObjectClass(env, o);
2347 LDKLockableScore_JCalls *calls = MALLOC(sizeof(LDKLockableScore_JCalls), "LDKLockableScore_JCalls");
2348 atomic_init(&calls->refcnt, 1);
2349 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
2350 calls->o = (*env)->NewWeakGlobalRef(env, o);
2351 calls->lock_meth = (*env)->GetMethodID(env, c, "lock", "()J");
2352 CHECK(calls->lock_meth != NULL);
2354 LDKLockableScore ret = {
2355 .this_arg = (void*) calls,
2356 .lock = lock_LDKLockableScore_jcall,
2357 .free = LDKLockableScore_JCalls_free,
2361 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKLockableScore_1new(JNIEnv *env, jclass clz, jobject o) {
2362 LDKLockableScore *res_ptr = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
2363 *res_ptr = LDKLockableScore_init(env, clz, o);
2364 return tag_ptr(res_ptr, true);
2366 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LockableScore_1lock(JNIEnv *env, jclass clz, int64_t this_arg) {
2367 void* this_arg_ptr = untag_ptr(this_arg);
2368 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2369 LDKLockableScore* this_arg_conv = (LDKLockableScore*)this_arg_ptr;
2370 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
2371 *ret_ret = (this_arg_conv->lock)(this_arg_conv->this_arg);
2372 return tag_ptr(ret_ret, true);
2375 typedef struct LDKWriteableScore_JCalls {
2376 atomic_size_t refcnt;
2379 LDKLockableScore_JCalls* LockableScore;
2380 jmethodID write_meth;
2381 } LDKWriteableScore_JCalls;
2382 static void LDKWriteableScore_JCalls_free(void* this_arg) {
2383 LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) this_arg;
2384 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2386 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2387 if (get_jenv_res == JNI_EDETACHED) {
2388 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2390 DO_ASSERT(get_jenv_res == JNI_OK);
2392 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
2393 if (get_jenv_res == JNI_EDETACHED) {
2394 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2399 LDKCVec_u8Z write_LDKWriteableScore_jcall(const void* this_arg) {
2400 LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) this_arg;
2402 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
2403 if (get_jenv_res == JNI_EDETACHED) {
2404 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
2406 DO_ASSERT(get_jenv_res == JNI_OK);
2408 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
2410 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
2411 if (UNLIKELY((*env)->ExceptionCheck(env))) {
2412 (*env)->ExceptionDescribe(env);
2413 (*env)->FatalError(env, "A call to write in LDKWriteableScore from rust threw an exception.");
2415 LDKCVec_u8Z ret_ref;
2416 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
2417 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
2418 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
2419 if (get_jenv_res == JNI_EDETACHED) {
2420 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
2424 static void LDKWriteableScore_JCalls_cloned(LDKWriteableScore* new_obj) {
2425 LDKWriteableScore_JCalls *j_calls = (LDKWriteableScore_JCalls*) new_obj->this_arg;
2426 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2427 atomic_fetch_add_explicit(&j_calls->LockableScore->refcnt, 1, memory_order_release);
2429 static inline LDKWriteableScore LDKWriteableScore_init (JNIEnv *env, jclass clz, jobject o, jobject LockableScore) {
2430 jclass c = (*env)->GetObjectClass(env, o);
2432 LDKWriteableScore_JCalls *calls = MALLOC(sizeof(LDKWriteableScore_JCalls), "LDKWriteableScore_JCalls");
2433 atomic_init(&calls->refcnt, 1);
2434 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
2435 calls->o = (*env)->NewWeakGlobalRef(env, o);
2436 calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
2437 CHECK(calls->write_meth != NULL);
2439 LDKWriteableScore ret = {
2440 .this_arg = (void*) calls,
2441 .write = write_LDKWriteableScore_jcall,
2442 .free = LDKWriteableScore_JCalls_free,
2443 .LockableScore = LDKLockableScore_init(env, clz, LockableScore),
2445 calls->LockableScore = ret.LockableScore.this_arg;
2448 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWriteableScore_1new(JNIEnv *env, jclass clz, jobject o, jobject LockableScore) {
2449 LDKWriteableScore *res_ptr = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore");
2450 *res_ptr = LDKWriteableScore_init(env, clz, o, LockableScore);
2451 return tag_ptr(res_ptr, true);
2453 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWriteableScore_1get_1LockableScore(JNIEnv *env, jclass clz, int64_t arg) {
2454 LDKWriteableScore *inp = (LDKWriteableScore *)untag_ptr(arg);
2455 return tag_ptr(&inp->LockableScore, false);
2457 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WriteableScore_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
2458 void* this_arg_ptr = untag_ptr(this_arg);
2459 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2460 LDKWriteableScore* this_arg_conv = (LDKWriteableScore*)this_arg_ptr;
2461 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
2462 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
2463 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
2464 CVec_u8Z_free(ret_var);
2468 static jclass LDKCOption_WriteableScoreZ_Some_class = NULL;
2469 static jmethodID LDKCOption_WriteableScoreZ_Some_meth = NULL;
2470 static jclass LDKCOption_WriteableScoreZ_None_class = NULL;
2471 static jmethodID LDKCOption_WriteableScoreZ_None_meth = NULL;
2472 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1WriteableScoreZ_init (JNIEnv *env, jclass clz) {
2473 LDKCOption_WriteableScoreZ_Some_class =
2474 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_WriteableScoreZ$Some"));
2475 CHECK(LDKCOption_WriteableScoreZ_Some_class != NULL);
2476 LDKCOption_WriteableScoreZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_WriteableScoreZ_Some_class, "<init>", "(J)V");
2477 CHECK(LDKCOption_WriteableScoreZ_Some_meth != NULL);
2478 LDKCOption_WriteableScoreZ_None_class =
2479 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_WriteableScoreZ$None"));
2480 CHECK(LDKCOption_WriteableScoreZ_None_class != NULL);
2481 LDKCOption_WriteableScoreZ_None_meth = (*env)->GetMethodID(env, LDKCOption_WriteableScoreZ_None_class, "<init>", "()V");
2482 CHECK(LDKCOption_WriteableScoreZ_None_meth != NULL);
2484 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1WriteableScoreZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2485 LDKCOption_WriteableScoreZ *obj = (LDKCOption_WriteableScoreZ*)untag_ptr(ptr);
2487 case LDKCOption_WriteableScoreZ_Some: {
2488 LDKWriteableScore* some_ret = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore");
2489 *some_ret = obj->some;
2490 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
2491 if ((*some_ret).free == LDKWriteableScore_JCalls_free) {
2492 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2493 LDKWriteableScore_JCalls_cloned(&(*some_ret));
2495 return (*env)->NewObject(env, LDKCOption_WriteableScoreZ_Some_class, LDKCOption_WriteableScoreZ_Some_meth, tag_ptr(some_ret, true));
2497 case LDKCOption_WriteableScoreZ_None: {
2498 return (*env)->NewObject(env, LDKCOption_WriteableScoreZ_None_class, LDKCOption_WriteableScoreZ_None_meth);
2503 static inline void CResult_NoneErrorZ_get_ok(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
2504 CHECK(owner->result_ok);
2505 return *owner->contents.result;
2507 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2508 LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
2509 CResult_NoneErrorZ_get_ok(owner_conv);
2512 static inline enum LDKIOError CResult_NoneErrorZ_get_err(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
2513 CHECK(!owner->result_ok);
2514 return *owner->contents.err;
2516 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2517 LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
2518 jclass ret_conv = LDKIOError_to_java(env, CResult_NoneErrorZ_get_err(owner_conv));
2522 static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
2523 LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
2524 for (size_t i = 0; i < ret.datalen; i++) {
2525 ret.data[i] = ChannelDetails_clone(&orig->data[i]);
2529 static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
2530 LDKRoute ret = *owner->contents.result;
2531 ret.is_owned = false;
2534 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2535 LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
2536 LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv);
2537 int64_t ret_ref = 0;
2538 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2539 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2543 static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
2544 LDKLightningError ret = *owner->contents.err;
2545 ret.is_owned = false;
2548 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2549 LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
2550 LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv);
2551 int64_t ret_ref = 0;
2552 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2553 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2557 static inline struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){
2558 LDKInFlightHtlcs ret = *owner->contents.result;
2559 ret.is_owned = false;
2562 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2563 LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner);
2564 LDKInFlightHtlcs ret_var = CResult_InFlightHtlcsDecodeErrorZ_get_ok(owner_conv);
2565 int64_t ret_ref = 0;
2566 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2567 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2571 static inline struct LDKDecodeError CResult_InFlightHtlcsDecodeErrorZ_get_err(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){
2572 CHECK(!owner->result_ok);
2573 return DecodeError_clone(&*owner->contents.err);
2575 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2576 LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner);
2577 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2578 *ret_copy = CResult_InFlightHtlcsDecodeErrorZ_get_err(owner_conv);
2579 int64_t ret_ref = tag_ptr(ret_copy, true);
2583 static inline struct LDKRouteHop CResult_RouteHopDecodeErrorZ_get_ok(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
2584 LDKRouteHop ret = *owner->contents.result;
2585 ret.is_owned = false;
2588 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2589 LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
2590 LDKRouteHop ret_var = CResult_RouteHopDecodeErrorZ_get_ok(owner_conv);
2591 int64_t ret_ref = 0;
2592 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2593 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2597 static inline struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
2598 CHECK(!owner->result_ok);
2599 return DecodeError_clone(&*owner->contents.err);
2601 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2602 LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
2603 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2604 *ret_copy = CResult_RouteHopDecodeErrorZ_get_err(owner_conv);
2605 int64_t ret_ref = tag_ptr(ret_copy, true);
2609 static inline LDKCVec_BlindedHopZ CVec_BlindedHopZ_clone(const LDKCVec_BlindedHopZ *orig) {
2610 LDKCVec_BlindedHopZ ret = { .data = MALLOC(sizeof(LDKBlindedHop) * orig->datalen, "LDKCVec_BlindedHopZ clone bytes"), .datalen = orig->datalen };
2611 for (size_t i = 0; i < ret.datalen; i++) {
2612 ret.data[i] = BlindedHop_clone(&orig->data[i]);
2616 static inline struct LDKBlindedTail CResult_BlindedTailDecodeErrorZ_get_ok(LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR owner){
2617 LDKBlindedTail ret = *owner->contents.result;
2618 ret.is_owned = false;
2621 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedTailDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2622 LDKCResult_BlindedTailDecodeErrorZ* owner_conv = (LDKCResult_BlindedTailDecodeErrorZ*)untag_ptr(owner);
2623 LDKBlindedTail ret_var = CResult_BlindedTailDecodeErrorZ_get_ok(owner_conv);
2624 int64_t ret_ref = 0;
2625 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2626 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2630 static inline struct LDKDecodeError CResult_BlindedTailDecodeErrorZ_get_err(LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR owner){
2631 CHECK(!owner->result_ok);
2632 return DecodeError_clone(&*owner->contents.err);
2634 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedTailDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2635 LDKCResult_BlindedTailDecodeErrorZ* owner_conv = (LDKCResult_BlindedTailDecodeErrorZ*)untag_ptr(owner);
2636 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2637 *ret_copy = CResult_BlindedTailDecodeErrorZ_get_err(owner_conv);
2638 int64_t ret_ref = tag_ptr(ret_copy, true);
2642 static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) {
2643 LDKCVec_RouteHopZ ret = { .data = MALLOC(sizeof(LDKRouteHop) * orig->datalen, "LDKCVec_RouteHopZ clone bytes"), .datalen = orig->datalen };
2644 for (size_t i = 0; i < ret.datalen; i++) {
2645 ret.data[i] = RouteHop_clone(&orig->data[i]);
2649 static inline LDKCVec_PathZ CVec_PathZ_clone(const LDKCVec_PathZ *orig) {
2650 LDKCVec_PathZ ret = { .data = MALLOC(sizeof(LDKPath) * orig->datalen, "LDKCVec_PathZ clone bytes"), .datalen = orig->datalen };
2651 for (size_t i = 0; i < ret.datalen; i++) {
2652 ret.data[i] = Path_clone(&orig->data[i]);
2656 static inline struct LDKRoute CResult_RouteDecodeErrorZ_get_ok(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
2657 LDKRoute ret = *owner->contents.result;
2658 ret.is_owned = false;
2661 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2662 LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
2663 LDKRoute ret_var = CResult_RouteDecodeErrorZ_get_ok(owner_conv);
2664 int64_t ret_ref = 0;
2665 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2666 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2670 static inline struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
2671 CHECK(!owner->result_ok);
2672 return DecodeError_clone(&*owner->contents.err);
2674 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2675 LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
2676 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2677 *ret_copy = CResult_RouteDecodeErrorZ_get_err(owner_conv);
2678 int64_t ret_ref = tag_ptr(ret_copy, true);
2682 static inline struct LDKRouteParameters CResult_RouteParametersDecodeErrorZ_get_ok(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
2683 LDKRouteParameters ret = *owner->contents.result;
2684 ret.is_owned = false;
2687 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2688 LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
2689 LDKRouteParameters ret_var = CResult_RouteParametersDecodeErrorZ_get_ok(owner_conv);
2690 int64_t ret_ref = 0;
2691 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2692 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2696 static inline struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
2697 CHECK(!owner->result_ok);
2698 return DecodeError_clone(&*owner->contents.err);
2700 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2701 LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
2702 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2703 *ret_copy = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv);
2704 int64_t ret_ref = tag_ptr(ret_copy, true);
2708 static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) {
2709 LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen };
2710 memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen);
2713 static inline struct LDKPaymentParameters CResult_PaymentParametersDecodeErrorZ_get_ok(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
2714 LDKPaymentParameters ret = *owner->contents.result;
2715 ret.is_owned = false;
2718 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2719 LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
2720 LDKPaymentParameters ret_var = CResult_PaymentParametersDecodeErrorZ_get_ok(owner_conv);
2721 int64_t ret_ref = 0;
2722 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2723 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2727 static inline struct LDKDecodeError CResult_PaymentParametersDecodeErrorZ_get_err(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
2728 CHECK(!owner->result_ok);
2729 return DecodeError_clone(&*owner->contents.err);
2731 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2732 LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
2733 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2734 *ret_copy = CResult_PaymentParametersDecodeErrorZ_get_err(owner_conv);
2735 int64_t ret_ref = tag_ptr(ret_copy, true);
2739 static inline struct LDKBlindedPayInfo C2Tuple_BlindedPayInfoBlindedPathZ_get_a(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner){
2740 LDKBlindedPayInfo ret = owner->a;
2741 ret.is_owned = false;
2744 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
2745 LDKC2Tuple_BlindedPayInfoBlindedPathZ* owner_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(owner);
2746 LDKBlindedPayInfo ret_var = C2Tuple_BlindedPayInfoBlindedPathZ_get_a(owner_conv);
2747 int64_t ret_ref = 0;
2748 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2749 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2753 static inline struct LDKBlindedPath C2Tuple_BlindedPayInfoBlindedPathZ_get_b(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR owner){
2754 LDKBlindedPath ret = owner->b;
2755 ret.is_owned = false;
2758 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
2759 LDKC2Tuple_BlindedPayInfoBlindedPathZ* owner_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(owner);
2760 LDKBlindedPath ret_var = C2Tuple_BlindedPayInfoBlindedPathZ_get_b(owner_conv);
2761 int64_t ret_ref = 0;
2762 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2763 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2767 static inline LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_clone(const LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ *orig) {
2768 LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ) * orig->datalen, "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ clone bytes"), .datalen = orig->datalen };
2769 for (size_t i = 0; i < ret.datalen; i++) {
2770 ret.data[i] = C2Tuple_BlindedPayInfoBlindedPathZ_clone(&orig->data[i]);
2774 static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) {
2775 LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen };
2776 for (size_t i = 0; i < ret.datalen; i++) {
2777 ret.data[i] = RouteHint_clone(&orig->data[i]);
2781 static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) {
2782 LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen };
2783 for (size_t i = 0; i < ret.datalen; i++) {
2784 ret.data[i] = RouteHintHop_clone(&orig->data[i]);
2788 static inline struct LDKRouteHint CResult_RouteHintDecodeErrorZ_get_ok(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
2789 LDKRouteHint ret = *owner->contents.result;
2790 ret.is_owned = false;
2793 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2794 LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
2795 LDKRouteHint ret_var = CResult_RouteHintDecodeErrorZ_get_ok(owner_conv);
2796 int64_t ret_ref = 0;
2797 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2798 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2802 static inline struct LDKDecodeError CResult_RouteHintDecodeErrorZ_get_err(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
2803 CHECK(!owner->result_ok);
2804 return DecodeError_clone(&*owner->contents.err);
2806 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2807 LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
2808 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2809 *ret_copy = CResult_RouteHintDecodeErrorZ_get_err(owner_conv);
2810 int64_t ret_ref = tag_ptr(ret_copy, true);
2814 static inline struct LDKRouteHintHop CResult_RouteHintHopDecodeErrorZ_get_ok(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
2815 LDKRouteHintHop ret = *owner->contents.result;
2816 ret.is_owned = false;
2819 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
2820 LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
2821 LDKRouteHintHop ret_var = CResult_RouteHintHopDecodeErrorZ_get_ok(owner_conv);
2822 int64_t ret_ref = 0;
2823 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2824 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2828 static inline struct LDKDecodeError CResult_RouteHintHopDecodeErrorZ_get_err(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
2829 CHECK(!owner->result_ok);
2830 return DecodeError_clone(&*owner->contents.err);
2832 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
2833 LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
2834 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
2835 *ret_copy = CResult_RouteHintHopDecodeErrorZ_get_err(owner_conv);
2836 int64_t ret_ref = tag_ptr(ret_copy, true);
2840 static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){
2843 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
2844 LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner);
2845 int64_t ret_conv = C2Tuple_usizeTransactionZ_get_a(owner_conv);
2849 static inline struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){
2852 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
2853 LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner);
2854 LDKTransaction ret_var = C2Tuple_usizeTransactionZ_get_b(owner_conv);
2855 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
2856 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
2860 static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) {
2861 LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen };
2862 for (size_t i = 0; i < ret.datalen; i++) {
2863 ret.data[i] = C2Tuple_usizeTransactionZ_clone(&orig->data[i]);
2867 static inline struct LDKThirtyTwoBytes C2Tuple_TxidBlockHashZ_get_a(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR owner){
2868 return ThirtyTwoBytes_clone(&owner->a);
2870 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
2871 LDKC2Tuple_TxidBlockHashZ* owner_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(owner);
2872 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
2873 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidBlockHashZ_get_a(owner_conv).data);
2877 static inline struct LDKThirtyTwoBytes C2Tuple_TxidBlockHashZ_get_b(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR owner){
2878 return ThirtyTwoBytes_clone(&owner->b);
2880 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
2881 LDKC2Tuple_TxidBlockHashZ* owner_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(owner);
2882 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
2883 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidBlockHashZ_get_b(owner_conv).data);
2887 static inline LDKCVec_C2Tuple_TxidBlockHashZZ CVec_C2Tuple_TxidBlockHashZZ_clone(const LDKCVec_C2Tuple_TxidBlockHashZZ *orig) {
2888 LDKCVec_C2Tuple_TxidBlockHashZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ) * orig->datalen, "LDKCVec_C2Tuple_TxidBlockHashZZ clone bytes"), .datalen = orig->datalen };
2889 for (size_t i = 0; i < ret.datalen; i++) {
2890 ret.data[i] = C2Tuple_TxidBlockHashZ_clone(&orig->data[i]);
2894 static jclass LDKMonitorEvent_HTLCEvent_class = NULL;
2895 static jmethodID LDKMonitorEvent_HTLCEvent_meth = NULL;
2896 static jclass LDKMonitorEvent_CommitmentTxConfirmed_class = NULL;
2897 static jmethodID LDKMonitorEvent_CommitmentTxConfirmed_meth = NULL;
2898 static jclass LDKMonitorEvent_Completed_class = NULL;
2899 static jmethodID LDKMonitorEvent_Completed_meth = NULL;
2900 static jclass LDKMonitorEvent_UpdateFailed_class = NULL;
2901 static jmethodID LDKMonitorEvent_UpdateFailed_meth = NULL;
2902 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMonitorEvent_init (JNIEnv *env, jclass clz) {
2903 LDKMonitorEvent_HTLCEvent_class =
2904 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$HTLCEvent"));
2905 CHECK(LDKMonitorEvent_HTLCEvent_class != NULL);
2906 LDKMonitorEvent_HTLCEvent_meth = (*env)->GetMethodID(env, LDKMonitorEvent_HTLCEvent_class, "<init>", "(J)V");
2907 CHECK(LDKMonitorEvent_HTLCEvent_meth != NULL);
2908 LDKMonitorEvent_CommitmentTxConfirmed_class =
2909 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$CommitmentTxConfirmed"));
2910 CHECK(LDKMonitorEvent_CommitmentTxConfirmed_class != NULL);
2911 LDKMonitorEvent_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_CommitmentTxConfirmed_class, "<init>", "(J)V");
2912 CHECK(LDKMonitorEvent_CommitmentTxConfirmed_meth != NULL);
2913 LDKMonitorEvent_Completed_class =
2914 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$Completed"));
2915 CHECK(LDKMonitorEvent_Completed_class != NULL);
2916 LDKMonitorEvent_Completed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_Completed_class, "<init>", "(JJ)V");
2917 CHECK(LDKMonitorEvent_Completed_meth != NULL);
2918 LDKMonitorEvent_UpdateFailed_class =
2919 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateFailed"));
2920 CHECK(LDKMonitorEvent_UpdateFailed_class != NULL);
2921 LDKMonitorEvent_UpdateFailed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateFailed_class, "<init>", "(J)V");
2922 CHECK(LDKMonitorEvent_UpdateFailed_meth != NULL);
2924 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
2925 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2927 case LDKMonitorEvent_HTLCEvent: {
2928 LDKHTLCUpdate htlc_event_var = obj->htlc_event;
2929 int64_t htlc_event_ref = 0;
2930 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var);
2931 htlc_event_ref = tag_ptr(htlc_event_var.inner, false);
2932 return (*env)->NewObject(env, LDKMonitorEvent_HTLCEvent_class, LDKMonitorEvent_HTLCEvent_meth, htlc_event_ref);
2934 case LDKMonitorEvent_CommitmentTxConfirmed: {
2935 LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed;
2936 int64_t commitment_tx_confirmed_ref = 0;
2937 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var);
2938 commitment_tx_confirmed_ref = tag_ptr(commitment_tx_confirmed_var.inner, false);
2939 return (*env)->NewObject(env, LDKMonitorEvent_CommitmentTxConfirmed_class, LDKMonitorEvent_CommitmentTxConfirmed_meth, commitment_tx_confirmed_ref);
2941 case LDKMonitorEvent_Completed: {
2942 LDKOutPoint funding_txo_var = obj->completed.funding_txo;
2943 int64_t funding_txo_ref = 0;
2944 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
2945 funding_txo_ref = tag_ptr(funding_txo_var.inner, false);
2946 int64_t monitor_update_id_conv = obj->completed.monitor_update_id;
2947 return (*env)->NewObject(env, LDKMonitorEvent_Completed_class, LDKMonitorEvent_Completed_meth, funding_txo_ref, monitor_update_id_conv);
2949 case LDKMonitorEvent_UpdateFailed: {
2950 LDKOutPoint update_failed_var = obj->update_failed;
2951 int64_t update_failed_ref = 0;
2952 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var);
2953 update_failed_ref = tag_ptr(update_failed_var.inner, false);
2954 return (*env)->NewObject(env, LDKMonitorEvent_UpdateFailed_class, LDKMonitorEvent_UpdateFailed_meth, update_failed_ref);
2959 static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) {
2960 LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen };
2961 for (size_t i = 0; i < ret.datalen; i++) {
2962 ret.data[i] = MonitorEvent_clone(&orig->data[i]);
2966 static inline struct LDKOutPoint C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
2967 LDKOutPoint ret = owner->a;
2968 ret.is_owned = false;
2971 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
2972 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
2973 LDKOutPoint ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(owner_conv);
2974 int64_t ret_ref = 0;
2975 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2976 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2980 static inline struct LDKCVec_MonitorEventZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
2981 return CVec_MonitorEventZ_clone(&owner->b);
2983 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
2984 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
2985 LDKCVec_MonitorEventZ ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(owner_conv);
2986 int64_tArray ret_arr = NULL;
2987 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
2988 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
2989 for (size_t o = 0; o < ret_var.datalen; o++) {
2990 LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
2991 *ret_conv_14_copy = ret_var.data[o];
2992 int64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true);
2993 ret_arr_ptr[o] = ret_conv_14_ref;
2995 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
3000 static inline struct LDKPublicKey C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
3003 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) {
3004 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
3005 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
3006 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(owner_conv).compressed_form);
3010 static inline LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_clone(const LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ *orig) {
3011 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ) * orig->datalen, "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ clone bytes"), .datalen = orig->datalen };
3012 for (size_t i = 0; i < ret.datalen; i++) {
3013 ret.data[i] = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(&orig->data[i]);
3017 static inline struct LDKFixedPenaltyScorer CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
3018 LDKFixedPenaltyScorer ret = *owner->contents.result;
3019 ret.is_owned = false;
3022 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3023 LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
3024 LDKFixedPenaltyScorer ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(owner_conv);
3025 int64_t ret_ref = 0;
3026 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3027 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3031 static inline struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
3032 CHECK(!owner->result_ok);
3033 return DecodeError_clone(&*owner->contents.err);
3035 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3036 LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
3037 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3038 *ret_copy = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv);
3039 int64_t ret_ref = tag_ptr(ret_copy, true);
3043 static inline uint64_t C2Tuple_u64u64Z_get_a(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){
3046 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
3047 LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner);
3048 int64_t ret_conv = C2Tuple_u64u64Z_get_a(owner_conv);
3052 static inline uint64_t C2Tuple_u64u64Z_get_b(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){
3055 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
3056 LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner);
3057 int64_t ret_conv = C2Tuple_u64u64Z_get_b(owner_conv);
3061 static jclass LDKCOption_C2Tuple_u64u64ZZ_Some_class = NULL;
3062 static jmethodID LDKCOption_C2Tuple_u64u64ZZ_Some_meth = NULL;
3063 static jclass LDKCOption_C2Tuple_u64u64ZZ_None_class = NULL;
3064 static jmethodID LDKCOption_C2Tuple_u64u64ZZ_None_meth = NULL;
3065 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1u64u64ZZ_init (JNIEnv *env, jclass clz) {
3066 LDKCOption_C2Tuple_u64u64ZZ_Some_class =
3067 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_u64u64ZZ$Some"));
3068 CHECK(LDKCOption_C2Tuple_u64u64ZZ_Some_class != NULL);
3069 LDKCOption_C2Tuple_u64u64ZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_u64u64ZZ_Some_class, "<init>", "(J)V");
3070 CHECK(LDKCOption_C2Tuple_u64u64ZZ_Some_meth != NULL);
3071 LDKCOption_C2Tuple_u64u64ZZ_None_class =
3072 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_u64u64ZZ$None"));
3073 CHECK(LDKCOption_C2Tuple_u64u64ZZ_None_class != NULL);
3074 LDKCOption_C2Tuple_u64u64ZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_u64u64ZZ_None_class, "<init>", "()V");
3075 CHECK(LDKCOption_C2Tuple_u64u64ZZ_None_meth != NULL);
3077 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1u64u64ZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3078 LDKCOption_C2Tuple_u64u64ZZ *obj = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(ptr);
3080 case LDKCOption_C2Tuple_u64u64ZZ_Some: {
3081 LDKC2Tuple_u64u64Z* some_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
3082 *some_conv = obj->some;
3083 *some_conv = C2Tuple_u64u64Z_clone(some_conv);
3084 return (*env)->NewObject(env, LDKCOption_C2Tuple_u64u64ZZ_Some_class, LDKCOption_C2Tuple_u64u64ZZ_Some_meth, tag_ptr(some_conv, true));
3086 case LDKCOption_C2Tuple_u64u64ZZ_None: {
3087 return (*env)->NewObject(env, LDKCOption_C2Tuple_u64u64ZZ_None_class, LDKCOption_C2Tuple_u64u64ZZ_None_meth);
3092 static inline struct LDKEightU16s C2Tuple_Z_get_a(LDKC2Tuple_Z *NONNULL_PTR owner){
3095 JNIEXPORT int16_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Z_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
3096 LDKC2Tuple_Z* owner_conv = (LDKC2Tuple_Z*)untag_ptr(owner);
3097 int16_tArray ret_arr = (*env)->NewShortArray(env, 8);
3098 (*env)->SetShortArrayRegion(env, ret_arr, 0, 8, C2Tuple_Z_get_a(owner_conv).data);
3102 static inline struct LDKEightU16s C2Tuple_Z_get_b(LDKC2Tuple_Z *NONNULL_PTR owner){
3105 JNIEXPORT int16_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Z_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
3106 LDKC2Tuple_Z* owner_conv = (LDKC2Tuple_Z*)untag_ptr(owner);
3107 int16_tArray ret_arr = (*env)->NewShortArray(env, 8);
3108 (*env)->SetShortArrayRegion(env, ret_arr, 0, 8, C2Tuple_Z_get_b(owner_conv).data);
3112 static inline struct LDKEightU16s C2Tuple__u168_u168Z_get_a(LDKC2Tuple__u168_u168Z *NONNULL_PTR owner){
3115 JNIEXPORT int16_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u168_1u168Z_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
3116 LDKC2Tuple__u168_u168Z* owner_conv = (LDKC2Tuple__u168_u168Z*)untag_ptr(owner);
3117 int16_tArray ret_arr = (*env)->NewShortArray(env, 8);
3118 (*env)->SetShortArrayRegion(env, ret_arr, 0, 8, C2Tuple__u168_u168Z_get_a(owner_conv).data);
3122 static inline struct LDKEightU16s C2Tuple__u168_u168Z_get_b(LDKC2Tuple__u168_u168Z *NONNULL_PTR owner){
3125 JNIEXPORT int16_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u168_1u168Z_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
3126 LDKC2Tuple__u168_u168Z* owner_conv = (LDKC2Tuple__u168_u168Z*)untag_ptr(owner);
3127 int16_tArray ret_arr = (*env)->NewShortArray(env, 8);
3128 (*env)->SetShortArrayRegion(env, ret_arr, 0, 8, C2Tuple__u168_u168Z_get_b(owner_conv).data);
3132 static jclass LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_class = NULL;
3133 static jmethodID LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_meth = NULL;
3134 static jclass LDKCOption_C2Tuple_EightU16sEightU16sZZ_None_class = NULL;
3135 static jmethodID LDKCOption_C2Tuple_EightU16sEightU16sZZ_None_meth = NULL;
3136 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1EightU16sEightU16sZZ_init (JNIEnv *env, jclass clz) {
3137 LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_class =
3138 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_EightU16sEightU16sZZ$Some"));
3139 CHECK(LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_class != NULL);
3140 LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_class, "<init>", "(J)V");
3141 CHECK(LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_meth != NULL);
3142 LDKCOption_C2Tuple_EightU16sEightU16sZZ_None_class =
3143 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C2Tuple_EightU16sEightU16sZZ$None"));
3144 CHECK(LDKCOption_C2Tuple_EightU16sEightU16sZZ_None_class != NULL);
3145 LDKCOption_C2Tuple_EightU16sEightU16sZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C2Tuple_EightU16sEightU16sZZ_None_class, "<init>", "()V");
3146 CHECK(LDKCOption_C2Tuple_EightU16sEightU16sZZ_None_meth != NULL);
3148 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C2Tuple_1EightU16sEightU16sZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3149 LDKCOption_C2Tuple_EightU16sEightU16sZZ *obj = (LDKCOption_C2Tuple_EightU16sEightU16sZZ*)untag_ptr(ptr);
3151 case LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some: {
3152 LDKC2Tuple__u168_u168Z* some_conv = MALLOC(sizeof(LDKC2Tuple__u168_u168Z), "LDKC2Tuple__u168_u168Z");
3153 *some_conv = obj->some;
3154 *some_conv = C2Tuple__u168_u168Z_clone(some_conv);
3155 return (*env)->NewObject(env, LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_class, LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some_meth, tag_ptr(some_conv, true));
3157 case LDKCOption_C2Tuple_EightU16sEightU16sZZ_None: {
3158 return (*env)->NewObject(env, LDKCOption_C2Tuple_EightU16sEightU16sZZ_None_class, LDKCOption_C2Tuple_EightU16sEightU16sZZ_None_meth);
3163 static inline LDKCVec_NodeIdZ CVec_NodeIdZ_clone(const LDKCVec_NodeIdZ *orig) {
3164 LDKCVec_NodeIdZ ret = { .data = MALLOC(sizeof(LDKNodeId) * orig->datalen, "LDKCVec_NodeIdZ clone bytes"), .datalen = orig->datalen };
3165 for (size_t i = 0; i < ret.datalen; i++) {
3166 ret.data[i] = NodeId_clone(&orig->data[i]);
3170 typedef struct LDKLogger_JCalls {
3171 atomic_size_t refcnt;
3176 static void LDKLogger_JCalls_free(void* this_arg) {
3177 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
3178 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
3180 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
3181 if (get_jenv_res == JNI_EDETACHED) {
3182 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
3184 DO_ASSERT(get_jenv_res == JNI_OK);
3186 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
3187 if (get_jenv_res == JNI_EDETACHED) {
3188 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
3193 void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) {
3194 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
3196 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
3197 if (get_jenv_res == JNI_EDETACHED) {
3198 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
3200 DO_ASSERT(get_jenv_res == JNI_OK);
3202 LDKRecord record_var = *record;
3203 int64_t record_ref = 0;
3204 record_var = Record_clone(&record_var);
3205 CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var);
3206 record_ref = tag_ptr(record_var.inner, record_var.is_owned);
3207 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
3209 (*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_ref);
3210 if (UNLIKELY((*env)->ExceptionCheck(env))) {
3211 (*env)->ExceptionDescribe(env);
3212 (*env)->FatalError(env, "A call to log in LDKLogger from rust threw an exception.");
3214 if (get_jenv_res == JNI_EDETACHED) {
3215 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
3218 static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) {
3219 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg;
3220 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
3222 static inline LDKLogger LDKLogger_init (JNIEnv *env, jclass clz, jobject o) {
3223 jclass c = (*env)->GetObjectClass(env, o);
3225 LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
3226 atomic_init(&calls->refcnt, 1);
3227 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
3228 calls->o = (*env)->NewWeakGlobalRef(env, o);
3229 calls->log_meth = (*env)->GetMethodID(env, c, "log", "(J)V");
3230 CHECK(calls->log_meth != NULL);
3233 .this_arg = (void*) calls,
3234 .log = log_LDKLogger_jcall,
3235 .free = LDKLogger_JCalls_free,
3239 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new(JNIEnv *env, jclass clz, jobject o) {
3240 LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger");
3241 *res_ptr = LDKLogger_init(env, clz, o);
3242 return tag_ptr(res_ptr, true);
3244 static inline struct LDKProbabilisticScorer CResult_ProbabilisticScorerDecodeErrorZ_get_ok(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
3245 LDKProbabilisticScorer ret = *owner->contents.result;
3246 ret.is_owned = false;
3249 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3250 LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
3251 LDKProbabilisticScorer ret_var = CResult_ProbabilisticScorerDecodeErrorZ_get_ok(owner_conv);
3252 int64_t ret_ref = 0;
3253 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3254 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3258 static inline struct LDKDecodeError CResult_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
3259 CHECK(!owner->result_ok);
3260 return DecodeError_clone(&*owner->contents.err);
3262 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3263 LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
3264 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3265 *ret_copy = CResult_ProbabilisticScorerDecodeErrorZ_get_err(owner_conv);
3266 int64_t ret_ref = tag_ptr(ret_copy, true);
3270 static inline struct LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
3271 LDKInitFeatures ret = *owner->contents.result;
3272 ret.is_owned = false;
3275 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3276 LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
3277 LDKInitFeatures ret_var = CResult_InitFeaturesDecodeErrorZ_get_ok(owner_conv);
3278 int64_t ret_ref = 0;
3279 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3280 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3284 static inline struct LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
3285 CHECK(!owner->result_ok);
3286 return DecodeError_clone(&*owner->contents.err);
3288 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3289 LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
3290 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3291 *ret_copy = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv);
3292 int64_t ret_ref = tag_ptr(ret_copy, true);
3296 static inline struct LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
3297 LDKChannelFeatures ret = *owner->contents.result;
3298 ret.is_owned = false;
3301 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3302 LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
3303 LDKChannelFeatures ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_ok(owner_conv);
3304 int64_t ret_ref = 0;
3305 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3306 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3310 static inline struct LDKDecodeError CResult_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
3311 CHECK(!owner->result_ok);
3312 return DecodeError_clone(&*owner->contents.err);
3314 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3315 LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
3316 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3317 *ret_copy = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv);
3318 int64_t ret_ref = tag_ptr(ret_copy, true);
3322 static inline struct LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
3323 LDKNodeFeatures ret = *owner->contents.result;
3324 ret.is_owned = false;
3327 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3328 LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
3329 LDKNodeFeatures ret_var = CResult_NodeFeaturesDecodeErrorZ_get_ok(owner_conv);
3330 int64_t ret_ref = 0;
3331 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3332 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3336 static inline struct LDKDecodeError CResult_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
3337 CHECK(!owner->result_ok);
3338 return DecodeError_clone(&*owner->contents.err);
3340 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3341 LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
3342 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3343 *ret_copy = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv);
3344 int64_t ret_ref = tag_ptr(ret_copy, true);
3348 static inline struct LDKInvoiceFeatures CResult_InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
3349 LDKInvoiceFeatures ret = *owner->contents.result;
3350 ret.is_owned = false;
3353 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3354 LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
3355 LDKInvoiceFeatures ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_ok(owner_conv);
3356 int64_t ret_ref = 0;
3357 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3358 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3362 static inline struct LDKDecodeError CResult_InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
3363 CHECK(!owner->result_ok);
3364 return DecodeError_clone(&*owner->contents.err);
3366 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3367 LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
3368 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3369 *ret_copy = CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner_conv);
3370 int64_t ret_ref = tag_ptr(ret_copy, true);
3374 static inline struct LDKBlindedHopFeatures CResult_BlindedHopFeaturesDecodeErrorZ_get_ok(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner){
3375 LDKBlindedHopFeatures ret = *owner->contents.result;
3376 ret.is_owned = false;
3379 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3380 LDKCResult_BlindedHopFeaturesDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(owner);
3381 LDKBlindedHopFeatures ret_var = CResult_BlindedHopFeaturesDecodeErrorZ_get_ok(owner_conv);
3382 int64_t ret_ref = 0;
3383 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3384 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3388 static inline struct LDKDecodeError CResult_BlindedHopFeaturesDecodeErrorZ_get_err(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR owner){
3389 CHECK(!owner->result_ok);
3390 return DecodeError_clone(&*owner->contents.err);
3392 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3393 LDKCResult_BlindedHopFeaturesDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(owner);
3394 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3395 *ret_copy = CResult_BlindedHopFeaturesDecodeErrorZ_get_err(owner_conv);
3396 int64_t ret_ref = tag_ptr(ret_copy, true);
3400 static inline struct LDKChannelTypeFeatures CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
3401 LDKChannelTypeFeatures ret = *owner->contents.result;
3402 ret.is_owned = false;
3405 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3406 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
3407 LDKChannelTypeFeatures ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(owner_conv);
3408 int64_t ret_ref = 0;
3409 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3410 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3414 static inline struct LDKDecodeError CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
3415 CHECK(!owner->result_ok);
3416 return DecodeError_clone(&*owner->contents.err);
3418 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3419 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
3420 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3421 *ret_copy = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv);
3422 int64_t ret_ref = tag_ptr(ret_copy, true);
3426 static jclass LDKPaymentPurpose_InvoicePayment_class = NULL;
3427 static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL;
3428 static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL;
3429 static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL;
3430 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) {
3431 LDKPaymentPurpose_InvoicePayment_class =
3432 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment"));
3433 CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL);
3434 LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "<init>", "([B[B)V");
3435 CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL);
3436 LDKPaymentPurpose_SpontaneousPayment_class =
3437 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment"));
3438 CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL);
3439 LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "<init>", "([B)V");
3440 CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL);
3442 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3443 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
3445 case LDKPaymentPurpose_InvoicePayment: {
3446 int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
3447 (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data);
3448 int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32);
3449 (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data);
3450 return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr);
3452 case LDKPaymentPurpose_SpontaneousPayment: {
3453 int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32);
3454 (*env)->SetByteArrayRegion(env, spontaneous_payment_arr, 0, 32, obj->spontaneous_payment.data);
3455 return (*env)->NewObject(env, LDKPaymentPurpose_SpontaneousPayment_class, LDKPaymentPurpose_SpontaneousPayment_meth, spontaneous_payment_arr);
3460 static inline struct LDKPaymentPurpose CResult_PaymentPurposeDecodeErrorZ_get_ok(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
3461 CHECK(owner->result_ok);
3462 return PaymentPurpose_clone(&*owner->contents.result);
3464 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3465 LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
3466 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
3467 *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_ok(owner_conv);
3468 int64_t ret_ref = tag_ptr(ret_copy, true);
3472 static inline struct LDKDecodeError CResult_PaymentPurposeDecodeErrorZ_get_err(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
3473 CHECK(!owner->result_ok);
3474 return DecodeError_clone(&*owner->contents.err);
3476 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3477 LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
3478 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3479 *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_err(owner_conv);
3480 int64_t ret_ref = tag_ptr(ret_copy, true);
3484 static jclass LDKNetworkUpdate_ChannelUpdateMessage_class = NULL;
3485 static jmethodID LDKNetworkUpdate_ChannelUpdateMessage_meth = NULL;
3486 static jclass LDKNetworkUpdate_ChannelFailure_class = NULL;
3487 static jmethodID LDKNetworkUpdate_ChannelFailure_meth = NULL;
3488 static jclass LDKNetworkUpdate_NodeFailure_class = NULL;
3489 static jmethodID LDKNetworkUpdate_NodeFailure_meth = NULL;
3490 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetworkUpdate_init (JNIEnv *env, jclass clz) {
3491 LDKNetworkUpdate_ChannelUpdateMessage_class =
3492 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelUpdateMessage"));
3493 CHECK(LDKNetworkUpdate_ChannelUpdateMessage_class != NULL);
3494 LDKNetworkUpdate_ChannelUpdateMessage_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelUpdateMessage_class, "<init>", "(J)V");
3495 CHECK(LDKNetworkUpdate_ChannelUpdateMessage_meth != NULL);
3496 LDKNetworkUpdate_ChannelFailure_class =
3497 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$ChannelFailure"));
3498 CHECK(LDKNetworkUpdate_ChannelFailure_class != NULL);
3499 LDKNetworkUpdate_ChannelFailure_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_ChannelFailure_class, "<init>", "(JZ)V");
3500 CHECK(LDKNetworkUpdate_ChannelFailure_meth != NULL);
3501 LDKNetworkUpdate_NodeFailure_class =
3502 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetworkUpdate$NodeFailure"));
3503 CHECK(LDKNetworkUpdate_NodeFailure_class != NULL);
3504 LDKNetworkUpdate_NodeFailure_meth = (*env)->GetMethodID(env, LDKNetworkUpdate_NodeFailure_class, "<init>", "([BZ)V");
3505 CHECK(LDKNetworkUpdate_NodeFailure_meth != NULL);
3507 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetworkUpdate_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3508 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
3510 case LDKNetworkUpdate_ChannelUpdateMessage: {
3511 LDKChannelUpdate msg_var = obj->channel_update_message.msg;
3512 int64_t msg_ref = 0;
3513 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3514 msg_ref = tag_ptr(msg_var.inner, false);
3515 return (*env)->NewObject(env, LDKNetworkUpdate_ChannelUpdateMessage_class, LDKNetworkUpdate_ChannelUpdateMessage_meth, msg_ref);
3517 case LDKNetworkUpdate_ChannelFailure: {
3518 int64_t short_channel_id_conv = obj->channel_failure.short_channel_id;
3519 jboolean is_permanent_conv = obj->channel_failure.is_permanent;
3520 return (*env)->NewObject(env, LDKNetworkUpdate_ChannelFailure_class, LDKNetworkUpdate_ChannelFailure_meth, short_channel_id_conv, is_permanent_conv);
3522 case LDKNetworkUpdate_NodeFailure: {
3523 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3524 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->node_failure.node_id.compressed_form);
3525 jboolean is_permanent_conv = obj->node_failure.is_permanent;
3526 return (*env)->NewObject(env, LDKNetworkUpdate_NodeFailure_class, LDKNetworkUpdate_NodeFailure_meth, node_id_arr, is_permanent_conv);
3531 static jclass LDKCOption_NetworkUpdateZ_Some_class = NULL;
3532 static jmethodID LDKCOption_NetworkUpdateZ_Some_meth = NULL;
3533 static jclass LDKCOption_NetworkUpdateZ_None_class = NULL;
3534 static jmethodID LDKCOption_NetworkUpdateZ_None_meth = NULL;
3535 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1NetworkUpdateZ_init (JNIEnv *env, jclass clz) {
3536 LDKCOption_NetworkUpdateZ_Some_class =
3537 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetworkUpdateZ$Some"));
3538 CHECK(LDKCOption_NetworkUpdateZ_Some_class != NULL);
3539 LDKCOption_NetworkUpdateZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_NetworkUpdateZ_Some_class, "<init>", "(J)V");
3540 CHECK(LDKCOption_NetworkUpdateZ_Some_meth != NULL);
3541 LDKCOption_NetworkUpdateZ_None_class =
3542 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetworkUpdateZ$None"));
3543 CHECK(LDKCOption_NetworkUpdateZ_None_class != NULL);
3544 LDKCOption_NetworkUpdateZ_None_meth = (*env)->GetMethodID(env, LDKCOption_NetworkUpdateZ_None_class, "<init>", "()V");
3545 CHECK(LDKCOption_NetworkUpdateZ_None_meth != NULL);
3547 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1NetworkUpdateZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3548 LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)untag_ptr(ptr);
3550 case LDKCOption_NetworkUpdateZ_Some: {
3551 int64_t some_ref = tag_ptr(&obj->some, false);
3552 return (*env)->NewObject(env, LDKCOption_NetworkUpdateZ_Some_class, LDKCOption_NetworkUpdateZ_Some_meth, some_ref);
3554 case LDKCOption_NetworkUpdateZ_None: {
3555 return (*env)->NewObject(env, LDKCOption_NetworkUpdateZ_None_class, LDKCOption_NetworkUpdateZ_None_meth);
3560 static jclass LDKPathFailure_InitialSend_class = NULL;
3561 static jmethodID LDKPathFailure_InitialSend_meth = NULL;
3562 static jclass LDKPathFailure_OnPath_class = NULL;
3563 static jmethodID LDKPathFailure_OnPath_meth = NULL;
3564 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPathFailure_init (JNIEnv *env, jclass clz) {
3565 LDKPathFailure_InitialSend_class =
3566 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPathFailure$InitialSend"));
3567 CHECK(LDKPathFailure_InitialSend_class != NULL);
3568 LDKPathFailure_InitialSend_meth = (*env)->GetMethodID(env, LDKPathFailure_InitialSend_class, "<init>", "(J)V");
3569 CHECK(LDKPathFailure_InitialSend_meth != NULL);
3570 LDKPathFailure_OnPath_class =
3571 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPathFailure$OnPath"));
3572 CHECK(LDKPathFailure_OnPath_class != NULL);
3573 LDKPathFailure_OnPath_meth = (*env)->GetMethodID(env, LDKPathFailure_OnPath_class, "<init>", "(J)V");
3574 CHECK(LDKPathFailure_OnPath_meth != NULL);
3576 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPathFailure_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3577 LDKPathFailure *obj = (LDKPathFailure*)untag_ptr(ptr);
3579 case LDKPathFailure_InitialSend: {
3580 int64_t err_ref = tag_ptr(&obj->initial_send.err, false);
3581 return (*env)->NewObject(env, LDKPathFailure_InitialSend_class, LDKPathFailure_InitialSend_meth, err_ref);
3583 case LDKPathFailure_OnPath: {
3584 int64_t network_update_ref = tag_ptr(&obj->on_path.network_update, false);
3585 return (*env)->NewObject(env, LDKPathFailure_OnPath_class, LDKPathFailure_OnPath_meth, network_update_ref);
3590 static jclass LDKCOption_PathFailureZ_Some_class = NULL;
3591 static jmethodID LDKCOption_PathFailureZ_Some_meth = NULL;
3592 static jclass LDKCOption_PathFailureZ_None_class = NULL;
3593 static jmethodID LDKCOption_PathFailureZ_None_meth = NULL;
3594 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1PathFailureZ_init (JNIEnv *env, jclass clz) {
3595 LDKCOption_PathFailureZ_Some_class =
3596 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_PathFailureZ$Some"));
3597 CHECK(LDKCOption_PathFailureZ_Some_class != NULL);
3598 LDKCOption_PathFailureZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_PathFailureZ_Some_class, "<init>", "(J)V");
3599 CHECK(LDKCOption_PathFailureZ_Some_meth != NULL);
3600 LDKCOption_PathFailureZ_None_class =
3601 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_PathFailureZ$None"));
3602 CHECK(LDKCOption_PathFailureZ_None_class != NULL);
3603 LDKCOption_PathFailureZ_None_meth = (*env)->GetMethodID(env, LDKCOption_PathFailureZ_None_class, "<init>", "()V");
3604 CHECK(LDKCOption_PathFailureZ_None_meth != NULL);
3606 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1PathFailureZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3607 LDKCOption_PathFailureZ *obj = (LDKCOption_PathFailureZ*)untag_ptr(ptr);
3609 case LDKCOption_PathFailureZ_Some: {
3610 int64_t some_ref = tag_ptr(&obj->some, false);
3611 return (*env)->NewObject(env, LDKCOption_PathFailureZ_Some_class, LDKCOption_PathFailureZ_Some_meth, some_ref);
3613 case LDKCOption_PathFailureZ_None: {
3614 return (*env)->NewObject(env, LDKCOption_PathFailureZ_None_class, LDKCOption_PathFailureZ_None_meth);
3619 static inline struct LDKCOption_PathFailureZ CResult_COption_PathFailureZDecodeErrorZ_get_ok(LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR owner){
3620 CHECK(owner->result_ok);
3621 return COption_PathFailureZ_clone(&*owner->contents.result);
3623 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PathFailureZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3624 LDKCResult_COption_PathFailureZDecodeErrorZ* owner_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(owner);
3625 LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ");
3626 *ret_copy = CResult_COption_PathFailureZDecodeErrorZ_get_ok(owner_conv);
3627 int64_t ret_ref = tag_ptr(ret_copy, true);
3631 static inline struct LDKDecodeError CResult_COption_PathFailureZDecodeErrorZ_get_err(LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR owner){
3632 CHECK(!owner->result_ok);
3633 return DecodeError_clone(&*owner->contents.err);
3635 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PathFailureZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3636 LDKCResult_COption_PathFailureZDecodeErrorZ* owner_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(owner);
3637 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3638 *ret_copy = CResult_COption_PathFailureZDecodeErrorZ_get_err(owner_conv);
3639 int64_t ret_ref = tag_ptr(ret_copy, true);
3643 static jclass LDKClosureReason_CounterpartyForceClosed_class = NULL;
3644 static jmethodID LDKClosureReason_CounterpartyForceClosed_meth = NULL;
3645 static jclass LDKClosureReason_HolderForceClosed_class = NULL;
3646 static jmethodID LDKClosureReason_HolderForceClosed_meth = NULL;
3647 static jclass LDKClosureReason_CooperativeClosure_class = NULL;
3648 static jmethodID LDKClosureReason_CooperativeClosure_meth = NULL;
3649 static jclass LDKClosureReason_CommitmentTxConfirmed_class = NULL;
3650 static jmethodID LDKClosureReason_CommitmentTxConfirmed_meth = NULL;
3651 static jclass LDKClosureReason_FundingTimedOut_class = NULL;
3652 static jmethodID LDKClosureReason_FundingTimedOut_meth = NULL;
3653 static jclass LDKClosureReason_ProcessingError_class = NULL;
3654 static jmethodID LDKClosureReason_ProcessingError_meth = NULL;
3655 static jclass LDKClosureReason_DisconnectedPeer_class = NULL;
3656 static jmethodID LDKClosureReason_DisconnectedPeer_meth = NULL;
3657 static jclass LDKClosureReason_OutdatedChannelManager_class = NULL;
3658 static jmethodID LDKClosureReason_OutdatedChannelManager_meth = NULL;
3659 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKClosureReason_init (JNIEnv *env, jclass clz) {
3660 LDKClosureReason_CounterpartyForceClosed_class =
3661 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CounterpartyForceClosed"));
3662 CHECK(LDKClosureReason_CounterpartyForceClosed_class != NULL);
3663 LDKClosureReason_CounterpartyForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_CounterpartyForceClosed_class, "<init>", "(J)V");
3664 CHECK(LDKClosureReason_CounterpartyForceClosed_meth != NULL);
3665 LDKClosureReason_HolderForceClosed_class =
3666 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$HolderForceClosed"));
3667 CHECK(LDKClosureReason_HolderForceClosed_class != NULL);
3668 LDKClosureReason_HolderForceClosed_meth = (*env)->GetMethodID(env, LDKClosureReason_HolderForceClosed_class, "<init>", "()V");
3669 CHECK(LDKClosureReason_HolderForceClosed_meth != NULL);
3670 LDKClosureReason_CooperativeClosure_class =
3671 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CooperativeClosure"));
3672 CHECK(LDKClosureReason_CooperativeClosure_class != NULL);
3673 LDKClosureReason_CooperativeClosure_meth = (*env)->GetMethodID(env, LDKClosureReason_CooperativeClosure_class, "<init>", "()V");
3674 CHECK(LDKClosureReason_CooperativeClosure_meth != NULL);
3675 LDKClosureReason_CommitmentTxConfirmed_class =
3676 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$CommitmentTxConfirmed"));
3677 CHECK(LDKClosureReason_CommitmentTxConfirmed_class != NULL);
3678 LDKClosureReason_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKClosureReason_CommitmentTxConfirmed_class, "<init>", "()V");
3679 CHECK(LDKClosureReason_CommitmentTxConfirmed_meth != NULL);
3680 LDKClosureReason_FundingTimedOut_class =
3681 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$FundingTimedOut"));
3682 CHECK(LDKClosureReason_FundingTimedOut_class != NULL);
3683 LDKClosureReason_FundingTimedOut_meth = (*env)->GetMethodID(env, LDKClosureReason_FundingTimedOut_class, "<init>", "()V");
3684 CHECK(LDKClosureReason_FundingTimedOut_meth != NULL);
3685 LDKClosureReason_ProcessingError_class =
3686 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$ProcessingError"));
3687 CHECK(LDKClosureReason_ProcessingError_class != NULL);
3688 LDKClosureReason_ProcessingError_meth = (*env)->GetMethodID(env, LDKClosureReason_ProcessingError_class, "<init>", "(Ljava/lang/String;)V");
3689 CHECK(LDKClosureReason_ProcessingError_meth != NULL);
3690 LDKClosureReason_DisconnectedPeer_class =
3691 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$DisconnectedPeer"));
3692 CHECK(LDKClosureReason_DisconnectedPeer_class != NULL);
3693 LDKClosureReason_DisconnectedPeer_meth = (*env)->GetMethodID(env, LDKClosureReason_DisconnectedPeer_class, "<init>", "()V");
3694 CHECK(LDKClosureReason_DisconnectedPeer_meth != NULL);
3695 LDKClosureReason_OutdatedChannelManager_class =
3696 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKClosureReason$OutdatedChannelManager"));
3697 CHECK(LDKClosureReason_OutdatedChannelManager_class != NULL);
3698 LDKClosureReason_OutdatedChannelManager_meth = (*env)->GetMethodID(env, LDKClosureReason_OutdatedChannelManager_class, "<init>", "()V");
3699 CHECK(LDKClosureReason_OutdatedChannelManager_meth != NULL);
3701 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKClosureReason_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3702 LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr);
3704 case LDKClosureReason_CounterpartyForceClosed: {
3705 LDKUntrustedString peer_msg_var = obj->counterparty_force_closed.peer_msg;
3706 int64_t peer_msg_ref = 0;
3707 CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_msg_var);
3708 peer_msg_ref = tag_ptr(peer_msg_var.inner, false);
3709 return (*env)->NewObject(env, LDKClosureReason_CounterpartyForceClosed_class, LDKClosureReason_CounterpartyForceClosed_meth, peer_msg_ref);
3711 case LDKClosureReason_HolderForceClosed: {
3712 return (*env)->NewObject(env, LDKClosureReason_HolderForceClosed_class, LDKClosureReason_HolderForceClosed_meth);
3714 case LDKClosureReason_CooperativeClosure: {
3715 return (*env)->NewObject(env, LDKClosureReason_CooperativeClosure_class, LDKClosureReason_CooperativeClosure_meth);
3717 case LDKClosureReason_CommitmentTxConfirmed: {
3718 return (*env)->NewObject(env, LDKClosureReason_CommitmentTxConfirmed_class, LDKClosureReason_CommitmentTxConfirmed_meth);
3720 case LDKClosureReason_FundingTimedOut: {
3721 return (*env)->NewObject(env, LDKClosureReason_FundingTimedOut_class, LDKClosureReason_FundingTimedOut_meth);
3723 case LDKClosureReason_ProcessingError: {
3724 LDKStr err_str = obj->processing_error.err;
3725 jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
3726 return (*env)->NewObject(env, LDKClosureReason_ProcessingError_class, LDKClosureReason_ProcessingError_meth, err_conv);
3728 case LDKClosureReason_DisconnectedPeer: {
3729 return (*env)->NewObject(env, LDKClosureReason_DisconnectedPeer_class, LDKClosureReason_DisconnectedPeer_meth);
3731 case LDKClosureReason_OutdatedChannelManager: {
3732 return (*env)->NewObject(env, LDKClosureReason_OutdatedChannelManager_class, LDKClosureReason_OutdatedChannelManager_meth);
3737 static jclass LDKCOption_ClosureReasonZ_Some_class = NULL;
3738 static jmethodID LDKCOption_ClosureReasonZ_Some_meth = NULL;
3739 static jclass LDKCOption_ClosureReasonZ_None_class = NULL;
3740 static jmethodID LDKCOption_ClosureReasonZ_None_meth = NULL;
3741 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1ClosureReasonZ_init (JNIEnv *env, jclass clz) {
3742 LDKCOption_ClosureReasonZ_Some_class =
3743 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_ClosureReasonZ$Some"));
3744 CHECK(LDKCOption_ClosureReasonZ_Some_class != NULL);
3745 LDKCOption_ClosureReasonZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_Some_class, "<init>", "(J)V");
3746 CHECK(LDKCOption_ClosureReasonZ_Some_meth != NULL);
3747 LDKCOption_ClosureReasonZ_None_class =
3748 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_ClosureReasonZ$None"));
3749 CHECK(LDKCOption_ClosureReasonZ_None_class != NULL);
3750 LDKCOption_ClosureReasonZ_None_meth = (*env)->GetMethodID(env, LDKCOption_ClosureReasonZ_None_class, "<init>", "()V");
3751 CHECK(LDKCOption_ClosureReasonZ_None_meth != NULL);
3753 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1ClosureReasonZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3754 LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)untag_ptr(ptr);
3756 case LDKCOption_ClosureReasonZ_Some: {
3757 int64_t some_ref = tag_ptr(&obj->some, false);
3758 return (*env)->NewObject(env, LDKCOption_ClosureReasonZ_Some_class, LDKCOption_ClosureReasonZ_Some_meth, some_ref);
3760 case LDKCOption_ClosureReasonZ_None: {
3761 return (*env)->NewObject(env, LDKCOption_ClosureReasonZ_None_class, LDKCOption_ClosureReasonZ_None_meth);
3766 static inline struct LDKCOption_ClosureReasonZ CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
3767 CHECK(owner->result_ok);
3768 return COption_ClosureReasonZ_clone(&*owner->contents.result);
3770 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3771 LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
3772 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
3773 *ret_copy = CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(owner_conv);
3774 int64_t ret_ref = tag_ptr(ret_copy, true);
3778 static inline struct LDKDecodeError CResult_COption_ClosureReasonZDecodeErrorZ_get_err(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
3779 CHECK(!owner->result_ok);
3780 return DecodeError_clone(&*owner->contents.err);
3782 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3783 LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
3784 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3785 *ret_copy = CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner_conv);
3786 int64_t ret_ref = tag_ptr(ret_copy, true);
3790 static jclass LDKHTLCDestination_NextHopChannel_class = NULL;
3791 static jmethodID LDKHTLCDestination_NextHopChannel_meth = NULL;
3792 static jclass LDKHTLCDestination_UnknownNextHop_class = NULL;
3793 static jmethodID LDKHTLCDestination_UnknownNextHop_meth = NULL;
3794 static jclass LDKHTLCDestination_InvalidForward_class = NULL;
3795 static jmethodID LDKHTLCDestination_InvalidForward_meth = NULL;
3796 static jclass LDKHTLCDestination_FailedPayment_class = NULL;
3797 static jmethodID LDKHTLCDestination_FailedPayment_meth = NULL;
3798 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHTLCDestination_init (JNIEnv *env, jclass clz) {
3799 LDKHTLCDestination_NextHopChannel_class =
3800 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHTLCDestination$NextHopChannel"));
3801 CHECK(LDKHTLCDestination_NextHopChannel_class != NULL);
3802 LDKHTLCDestination_NextHopChannel_meth = (*env)->GetMethodID(env, LDKHTLCDestination_NextHopChannel_class, "<init>", "([B[B)V");
3803 CHECK(LDKHTLCDestination_NextHopChannel_meth != NULL);
3804 LDKHTLCDestination_UnknownNextHop_class =
3805 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHTLCDestination$UnknownNextHop"));
3806 CHECK(LDKHTLCDestination_UnknownNextHop_class != NULL);
3807 LDKHTLCDestination_UnknownNextHop_meth = (*env)->GetMethodID(env, LDKHTLCDestination_UnknownNextHop_class, "<init>", "(J)V");
3808 CHECK(LDKHTLCDestination_UnknownNextHop_meth != NULL);
3809 LDKHTLCDestination_InvalidForward_class =
3810 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHTLCDestination$InvalidForward"));
3811 CHECK(LDKHTLCDestination_InvalidForward_class != NULL);
3812 LDKHTLCDestination_InvalidForward_meth = (*env)->GetMethodID(env, LDKHTLCDestination_InvalidForward_class, "<init>", "(J)V");
3813 CHECK(LDKHTLCDestination_InvalidForward_meth != NULL);
3814 LDKHTLCDestination_FailedPayment_class =
3815 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHTLCDestination$FailedPayment"));
3816 CHECK(LDKHTLCDestination_FailedPayment_class != NULL);
3817 LDKHTLCDestination_FailedPayment_meth = (*env)->GetMethodID(env, LDKHTLCDestination_FailedPayment_class, "<init>", "([B)V");
3818 CHECK(LDKHTLCDestination_FailedPayment_meth != NULL);
3820 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKHTLCDestination_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3821 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
3823 case LDKHTLCDestination_NextHopChannel: {
3824 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
3825 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->next_hop_channel.node_id.compressed_form);
3826 int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32);
3827 (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->next_hop_channel.channel_id.data);
3828 return (*env)->NewObject(env, LDKHTLCDestination_NextHopChannel_class, LDKHTLCDestination_NextHopChannel_meth, node_id_arr, channel_id_arr);
3830 case LDKHTLCDestination_UnknownNextHop: {
3831 int64_t requested_forward_scid_conv = obj->unknown_next_hop.requested_forward_scid;
3832 return (*env)->NewObject(env, LDKHTLCDestination_UnknownNextHop_class, LDKHTLCDestination_UnknownNextHop_meth, requested_forward_scid_conv);
3834 case LDKHTLCDestination_InvalidForward: {
3835 int64_t requested_forward_scid_conv = obj->invalid_forward.requested_forward_scid;
3836 return (*env)->NewObject(env, LDKHTLCDestination_InvalidForward_class, LDKHTLCDestination_InvalidForward_meth, requested_forward_scid_conv);
3838 case LDKHTLCDestination_FailedPayment: {
3839 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
3840 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->failed_payment.payment_hash.data);
3841 return (*env)->NewObject(env, LDKHTLCDestination_FailedPayment_class, LDKHTLCDestination_FailedPayment_meth, payment_hash_arr);
3846 static jclass LDKCOption_HTLCDestinationZ_Some_class = NULL;
3847 static jmethodID LDKCOption_HTLCDestinationZ_Some_meth = NULL;
3848 static jclass LDKCOption_HTLCDestinationZ_None_class = NULL;
3849 static jmethodID LDKCOption_HTLCDestinationZ_None_meth = NULL;
3850 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1HTLCDestinationZ_init (JNIEnv *env, jclass clz) {
3851 LDKCOption_HTLCDestinationZ_Some_class =
3852 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_HTLCDestinationZ$Some"));
3853 CHECK(LDKCOption_HTLCDestinationZ_Some_class != NULL);
3854 LDKCOption_HTLCDestinationZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_HTLCDestinationZ_Some_class, "<init>", "(J)V");
3855 CHECK(LDKCOption_HTLCDestinationZ_Some_meth != NULL);
3856 LDKCOption_HTLCDestinationZ_None_class =
3857 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_HTLCDestinationZ$None"));
3858 CHECK(LDKCOption_HTLCDestinationZ_None_class != NULL);
3859 LDKCOption_HTLCDestinationZ_None_meth = (*env)->GetMethodID(env, LDKCOption_HTLCDestinationZ_None_class, "<init>", "()V");
3860 CHECK(LDKCOption_HTLCDestinationZ_None_meth != NULL);
3862 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1HTLCDestinationZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3863 LDKCOption_HTLCDestinationZ *obj = (LDKCOption_HTLCDestinationZ*)untag_ptr(ptr);
3865 case LDKCOption_HTLCDestinationZ_Some: {
3866 int64_t some_ref = tag_ptr(&obj->some, false);
3867 return (*env)->NewObject(env, LDKCOption_HTLCDestinationZ_Some_class, LDKCOption_HTLCDestinationZ_Some_meth, some_ref);
3869 case LDKCOption_HTLCDestinationZ_None: {
3870 return (*env)->NewObject(env, LDKCOption_HTLCDestinationZ_None_class, LDKCOption_HTLCDestinationZ_None_meth);
3875 static inline struct LDKCOption_HTLCDestinationZ CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
3876 CHECK(owner->result_ok);
3877 return COption_HTLCDestinationZ_clone(&*owner->contents.result);
3879 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3880 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
3881 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
3882 *ret_copy = CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(owner_conv);
3883 int64_t ret_ref = tag_ptr(ret_copy, true);
3887 static inline struct LDKDecodeError CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
3888 CHECK(!owner->result_ok);
3889 return DecodeError_clone(&*owner->contents.err);
3891 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3892 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
3893 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3894 *ret_copy = CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(owner_conv);
3895 int64_t ret_ref = tag_ptr(ret_copy, true);
3899 static inline enum LDKPaymentFailureReason CResult_PaymentFailureReasonDecodeErrorZ_get_ok(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR owner){
3900 CHECK(owner->result_ok);
3901 return PaymentFailureReason_clone(&*owner->contents.result);
3903 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
3904 LDKCResult_PaymentFailureReasonDecodeErrorZ* owner_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(owner);
3905 jclass ret_conv = LDKPaymentFailureReason_to_java(env, CResult_PaymentFailureReasonDecodeErrorZ_get_ok(owner_conv));
3909 static inline struct LDKDecodeError CResult_PaymentFailureReasonDecodeErrorZ_get_err(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR owner){
3910 CHECK(!owner->result_ok);
3911 return DecodeError_clone(&*owner->contents.err);
3913 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
3914 LDKCResult_PaymentFailureReasonDecodeErrorZ* owner_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(owner);
3915 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3916 *ret_copy = CResult_PaymentFailureReasonDecodeErrorZ_get_err(owner_conv);
3917 int64_t ret_ref = tag_ptr(ret_copy, true);
3921 static jclass LDKCOption_u128Z_Some_class = NULL;
3922 static jmethodID LDKCOption_u128Z_Some_meth = NULL;
3923 static jclass LDKCOption_u128Z_None_class = NULL;
3924 static jmethodID LDKCOption_u128Z_None_meth = NULL;
3925 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u128Z_init (JNIEnv *env, jclass clz) {
3926 LDKCOption_u128Z_Some_class =
3927 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u128Z$Some"));
3928 CHECK(LDKCOption_u128Z_Some_class != NULL);
3929 LDKCOption_u128Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u128Z_Some_class, "<init>", "([B)V");
3930 CHECK(LDKCOption_u128Z_Some_meth != NULL);
3931 LDKCOption_u128Z_None_class =
3932 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u128Z$None"));
3933 CHECK(LDKCOption_u128Z_None_class != NULL);
3934 LDKCOption_u128Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u128Z_None_class, "<init>", "()V");
3935 CHECK(LDKCOption_u128Z_None_meth != NULL);
3937 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u128Z_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3938 LDKCOption_u128Z *obj = (LDKCOption_u128Z*)untag_ptr(ptr);
3940 case LDKCOption_u128Z_Some: {
3941 int8_tArray some_arr = (*env)->NewByteArray(env, 16);
3942 (*env)->SetByteArrayRegion(env, some_arr, 0, 16, obj->some.le_bytes);
3943 return (*env)->NewObject(env, LDKCOption_u128Z_Some_class, LDKCOption_u128Z_Some_meth, some_arr);
3945 case LDKCOption_u128Z_None: {
3946 return (*env)->NewObject(env, LDKCOption_u128Z_None_class, LDKCOption_u128Z_None_meth);
3951 static jclass LDKCOption_PaymentFailureReasonZ_Some_class = NULL;
3952 static jmethodID LDKCOption_PaymentFailureReasonZ_Some_meth = NULL;
3953 static jclass LDKCOption_PaymentFailureReasonZ_None_class = NULL;
3954 static jmethodID LDKCOption_PaymentFailureReasonZ_None_meth = NULL;
3955 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1PaymentFailureReasonZ_init (JNIEnv *env, jclass clz) {
3956 LDKCOption_PaymentFailureReasonZ_Some_class =
3957 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_PaymentFailureReasonZ$Some"));
3958 CHECK(LDKCOption_PaymentFailureReasonZ_Some_class != NULL);
3959 LDKCOption_PaymentFailureReasonZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_PaymentFailureReasonZ_Some_class, "<init>", "(Lorg/ldk/enums/PaymentFailureReason;)V");
3960 CHECK(LDKCOption_PaymentFailureReasonZ_Some_meth != NULL);
3961 LDKCOption_PaymentFailureReasonZ_None_class =
3962 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_PaymentFailureReasonZ$None"));
3963 CHECK(LDKCOption_PaymentFailureReasonZ_None_class != NULL);
3964 LDKCOption_PaymentFailureReasonZ_None_meth = (*env)->GetMethodID(env, LDKCOption_PaymentFailureReasonZ_None_class, "<init>", "()V");
3965 CHECK(LDKCOption_PaymentFailureReasonZ_None_meth != NULL);
3967 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1PaymentFailureReasonZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
3968 LDKCOption_PaymentFailureReasonZ *obj = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(ptr);
3970 case LDKCOption_PaymentFailureReasonZ_Some: {
3971 jclass some_conv = LDKPaymentFailureReason_to_java(env, obj->some);
3972 return (*env)->NewObject(env, LDKCOption_PaymentFailureReasonZ_Some_class, LDKCOption_PaymentFailureReasonZ_Some_meth, some_conv);
3974 case LDKCOption_PaymentFailureReasonZ_None: {
3975 return (*env)->NewObject(env, LDKCOption_PaymentFailureReasonZ_None_class, LDKCOption_PaymentFailureReasonZ_None_meth);
3980 static jclass LDKSpendableOutputDescriptor_StaticOutput_class = NULL;
3981 static jmethodID LDKSpendableOutputDescriptor_StaticOutput_meth = NULL;
3982 static jclass LDKSpendableOutputDescriptor_DelayedPaymentOutput_class = NULL;
3983 static jmethodID LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth = NULL;
3984 static jclass LDKSpendableOutputDescriptor_StaticPaymentOutput_class = NULL;
3985 static jmethodID LDKSpendableOutputDescriptor_StaticPaymentOutput_meth = NULL;
3986 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSpendableOutputDescriptor_init (JNIEnv *env, jclass clz) {
3987 LDKSpendableOutputDescriptor_StaticOutput_class =
3988 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutput"));
3989 CHECK(LDKSpendableOutputDescriptor_StaticOutput_class != NULL);
3990 LDKSpendableOutputDescriptor_StaticOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticOutput_class, "<init>", "(JJ)V");
3991 CHECK(LDKSpendableOutputDescriptor_StaticOutput_meth != NULL);
3992 LDKSpendableOutputDescriptor_DelayedPaymentOutput_class =
3993 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSpendableOutputDescriptor$DelayedPaymentOutput"));
3994 CHECK(LDKSpendableOutputDescriptor_DelayedPaymentOutput_class != NULL);
3995 LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, "<init>", "(J)V");
3996 CHECK(LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth != NULL);
3997 LDKSpendableOutputDescriptor_StaticPaymentOutput_class =
3998 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticPaymentOutput"));
3999 CHECK(LDKSpendableOutputDescriptor_StaticPaymentOutput_class != NULL);
4000 LDKSpendableOutputDescriptor_StaticPaymentOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, "<init>", "(J)V");
4001 CHECK(LDKSpendableOutputDescriptor_StaticPaymentOutput_meth != NULL);
4003 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
4004 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
4006 case LDKSpendableOutputDescriptor_StaticOutput: {
4007 LDKOutPoint outpoint_var = obj->static_output.outpoint;
4008 int64_t outpoint_ref = 0;
4009 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var);
4010 outpoint_ref = tag_ptr(outpoint_var.inner, false);
4011 LDKTxOut* output_ref = &obj->static_output.output;
4012 return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticOutput_class, LDKSpendableOutputDescriptor_StaticOutput_meth, outpoint_ref, tag_ptr(output_ref, false));
4014 case LDKSpendableOutputDescriptor_DelayedPaymentOutput: {
4015 LDKDelayedPaymentOutputDescriptor delayed_payment_output_var = obj->delayed_payment_output;
4016 int64_t delayed_payment_output_ref = 0;
4017 CHECK_INNER_FIELD_ACCESS_OR_NULL(delayed_payment_output_var);
4018 delayed_payment_output_ref = tag_ptr(delayed_payment_output_var.inner, false);
4019 return (*env)->NewObject(env, LDKSpendableOutputDescriptor_DelayedPaymentOutput_class, LDKSpendableOutputDescriptor_DelayedPaymentOutput_meth, delayed_payment_output_ref);
4021 case LDKSpendableOutputDescriptor_StaticPaymentOutput: {
4022 LDKStaticPaymentOutputDescriptor static_payment_output_var = obj->static_payment_output;
4023 int64_t static_payment_output_ref = 0;
4024 CHECK_INNER_FIELD_ACCESS_OR_NULL(static_payment_output_var);
4025 static_payment_output_ref = tag_ptr(static_payment_output_var.inner, false);
4026 return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticPaymentOutput_class, LDKSpendableOutputDescriptor_StaticPaymentOutput_meth, static_payment_output_ref);
4031 static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ_clone(const LDKCVec_SpendableOutputDescriptorZ *orig) {
4032 LDKCVec_SpendableOutputDescriptorZ ret = { .data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * orig->datalen, "LDKCVec_SpendableOutputDescriptorZ clone bytes"), .datalen = orig->datalen };
4033 for (size_t i = 0; i < ret.datalen; i++) {
4034 ret.data[i] = SpendableOutputDescriptor_clone(&orig->data[i]);
4038 static jclass LDKEvent_FundingGenerationReady_class = NULL;
4039 static jmethodID LDKEvent_FundingGenerationReady_meth = NULL;
4040 static jclass LDKEvent_PaymentClaimable_class = NULL;
4041 static jmethodID LDKEvent_PaymentClaimable_meth = NULL;
4042 static jclass LDKEvent_PaymentClaimed_class = NULL;
4043 static jmethodID LDKEvent_PaymentClaimed_meth = NULL;
4044 static jclass LDKEvent_PaymentSent_class = NULL;
4045 static jmethodID LDKEvent_PaymentSent_meth = NULL;
4046 static jclass LDKEvent_PaymentFailed_class = NULL;
4047 static jmethodID LDKEvent_PaymentFailed_meth = NULL;
4048 static jclass LDKEvent_PaymentPathSuccessful_class = NULL;
4049 static jmethodID LDKEvent_PaymentPathSuccessful_meth = NULL;
4050 static jclass LDKEvent_PaymentPathFailed_class = NULL;
4051 static jmethodID LDKEvent_PaymentPathFailed_meth = NULL;
4052 static jclass LDKEvent_ProbeSuccessful_class = NULL;
4053 static jmethodID LDKEvent_ProbeSuccessful_meth = NULL;
4054 static jclass LDKEvent_ProbeFailed_class = NULL;
4055 static jmethodID LDKEvent_ProbeFailed_meth = NULL;
4056 static jclass LDKEvent_PendingHTLCsForwardable_class = NULL;
4057 static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL;
4058 static jclass LDKEvent_HTLCIntercepted_class = NULL;
4059 static jmethodID LDKEvent_HTLCIntercepted_meth = NULL;
4060 static jclass LDKEvent_SpendableOutputs_class = NULL;
4061 static jmethodID LDKEvent_SpendableOutputs_meth = NULL;
4062 static jclass LDKEvent_PaymentForwarded_class = NULL;
4063 static jmethodID LDKEvent_PaymentForwarded_meth = NULL;
4064 static jclass LDKEvent_ChannelPending_class = NULL;
4065 static jmethodID LDKEvent_ChannelPending_meth = NULL;
4066 static jclass LDKEvent_ChannelReady_class = NULL;
4067 static jmethodID LDKEvent_ChannelReady_meth = NULL;
4068 static jclass LDKEvent_ChannelClosed_class = NULL;
4069 static jmethodID LDKEvent_ChannelClosed_meth = NULL;
4070 static jclass LDKEvent_DiscardFunding_class = NULL;
4071 static jmethodID LDKEvent_DiscardFunding_meth = NULL;
4072 static jclass LDKEvent_OpenChannelRequest_class = NULL;
4073 static jmethodID LDKEvent_OpenChannelRequest_meth = NULL;
4074 static jclass LDKEvent_HTLCHandlingFailed_class = NULL;
4075 static jmethodID LDKEvent_HTLCHandlingFailed_meth = NULL;
4076 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *env, jclass clz) {
4077 LDKEvent_FundingGenerationReady_class =
4078 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$FundingGenerationReady"));
4079 CHECK(LDKEvent_FundingGenerationReady_class != NULL);
4080 LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "<init>", "([B[BJ[B[B)V");
4081 CHECK(LDKEvent_FundingGenerationReady_meth != NULL);
4082 LDKEvent_PaymentClaimable_class =
4083 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentClaimable"));
4084 CHECK(LDKEvent_PaymentClaimable_class != NULL);
4085 LDKEvent_PaymentClaimable_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimable_class, "<init>", "([B[BJJJ[BJJ)V");
4086 CHECK(LDKEvent_PaymentClaimable_meth != NULL);
4087 LDKEvent_PaymentClaimed_class =
4088 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentClaimed"));
4089 CHECK(LDKEvent_PaymentClaimed_class != NULL);
4090 LDKEvent_PaymentClaimed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimed_class, "<init>", "([B[BJJ)V");
4091 CHECK(LDKEvent_PaymentClaimed_meth != NULL);
4092 LDKEvent_PaymentSent_class =
4093 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentSent"));
4094 CHECK(LDKEvent_PaymentSent_class != NULL);
4095 LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "<init>", "([B[B[BJ)V");
4096 CHECK(LDKEvent_PaymentSent_meth != NULL);
4097 LDKEvent_PaymentFailed_class =
4098 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentFailed"));
4099 CHECK(LDKEvent_PaymentFailed_class != NULL);
4100 LDKEvent_PaymentFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentFailed_class, "<init>", "([B[BJ)V");
4101 CHECK(LDKEvent_PaymentFailed_meth != NULL);
4102 LDKEvent_PaymentPathSuccessful_class =
4103 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathSuccessful"));
4104 CHECK(LDKEvent_PaymentPathSuccessful_class != NULL);
4105 LDKEvent_PaymentPathSuccessful_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathSuccessful_class, "<init>", "([B[BJ)V");
4106 CHECK(LDKEvent_PaymentPathSuccessful_meth != NULL);
4107 LDKEvent_PaymentPathFailed_class =
4108 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentPathFailed"));
4109 CHECK(LDKEvent_PaymentPathFailed_class != NULL);
4110 LDKEvent_PaymentPathFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentPathFailed_class, "<init>", "([B[BZJJJ)V");
4111 CHECK(LDKEvent_PaymentPathFailed_meth != NULL);
4112 LDKEvent_ProbeSuccessful_class =
4113 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ProbeSuccessful"));
4114 CHECK(LDKEvent_ProbeSuccessful_class != NULL);
4115 LDKEvent_ProbeSuccessful_meth = (*env)->GetMethodID(env, LDKEvent_ProbeSuccessful_class, "<init>", "([B[BJ)V");
4116 CHECK(LDKEvent_ProbeSuccessful_meth != NULL);
4117 LDKEvent_ProbeFailed_class =
4118 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ProbeFailed"));
4119 CHECK(LDKEvent_ProbeFailed_class != NULL);
4120 LDKEvent_ProbeFailed_meth = (*env)->GetMethodID(env, LDKEvent_ProbeFailed_class, "<init>", "([B[BJJ)V");
4121 CHECK(LDKEvent_ProbeFailed_meth != NULL);
4122 LDKEvent_PendingHTLCsForwardable_class =
4123 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable"));
4124 CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL);
4125 LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "<init>", "(J)V");
4126 CHECK(LDKEvent_PendingHTLCsForwardable_meth != NULL);
4127 LDKEvent_HTLCIntercepted_class =
4128 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$HTLCIntercepted"));
4129 CHECK(LDKEvent_HTLCIntercepted_class != NULL);
4130 LDKEvent_HTLCIntercepted_meth = (*env)->GetMethodID(env, LDKEvent_HTLCIntercepted_class, "<init>", "([BJ[BJJ)V");
4131 CHECK(LDKEvent_HTLCIntercepted_meth != NULL);
4132 LDKEvent_SpendableOutputs_class =
4133 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$SpendableOutputs"));
4134 CHECK(LDKEvent_SpendableOutputs_class != NULL);
4135 LDKEvent_SpendableOutputs_meth = (*env)->GetMethodID(env, LDKEvent_SpendableOutputs_class, "<init>", "([J)V");
4136 CHECK(LDKEvent_SpendableOutputs_meth != NULL);
4137 LDKEvent_PaymentForwarded_class =
4138 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentForwarded"));
4139 CHECK(LDKEvent_PaymentForwarded_class != NULL);
4140 LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "<init>", "([B[BJZJ)V");
4141 CHECK(LDKEvent_PaymentForwarded_meth != NULL);
4142 LDKEvent_ChannelPending_class =
4143 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ChannelPending"));
4144 CHECK(LDKEvent_ChannelPending_class != NULL);
4145 LDKEvent_ChannelPending_meth = (*env)->GetMethodID(env, LDKEvent_ChannelPending_class, "<init>", "([B[B[B[BJ)V");
4146 CHECK(LDKEvent_ChannelPending_meth != NULL);
4147 LDKEvent_ChannelReady_class =
4148 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ChannelReady"));
4149 CHECK(LDKEvent_ChannelReady_class != NULL);
4150 LDKEvent_ChannelReady_meth = (*env)->GetMethodID(env, LDKEvent_ChannelReady_class, "<init>", "([B[B[BJ)V");
4151 CHECK(LDKEvent_ChannelReady_meth != NULL);
4152 LDKEvent_ChannelClosed_class =
4153 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ChannelClosed"));
4154 CHECK(LDKEvent_ChannelClosed_class != NULL);
4155 LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "<init>", "([B[BJ)V");
4156 CHECK(LDKEvent_ChannelClosed_meth != NULL);
4157 LDKEvent_DiscardFunding_class =
4158 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$DiscardFunding"));
4159 CHECK(LDKEvent_DiscardFunding_class != NULL);
4160 LDKEvent_DiscardFunding_meth = (*env)->GetMethodID(env, LDKEvent_DiscardFunding_class, "<init>", "([B[B)V");
4161 CHECK(LDKEvent_DiscardFunding_meth != NULL);
4162 LDKEvent_OpenChannelRequest_class =
4163 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$OpenChannelRequest"));
4164 CHECK(LDKEvent_OpenChannelRequest_class != NULL);
4165 LDKEvent_OpenChannelRequest_meth = (*env)->GetMethodID(env, LDKEvent_OpenChannelRequest_class, "<init>", "([B[BJJJ)V");
4166 CHECK(LDKEvent_OpenChannelRequest_meth != NULL);
4167 LDKEvent_HTLCHandlingFailed_class =
4168 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$HTLCHandlingFailed"));
4169 CHECK(LDKEvent_HTLCHandlingFailed_class != NULL);
4170 LDKEvent_HTLCHandlingFailed_meth = (*env)->GetMethodID(env, LDKEvent_HTLCHandlingFailed_class, "<init>", "([BJ)V");
4171 CHECK(LDKEvent_HTLCHandlingFailed_meth != NULL);
4173 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
4174 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
4176 case LDKEvent_FundingGenerationReady: {
4177 int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32);
4178 (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->funding_generation_ready.temporary_channel_id.data);
4179 int8_tArray counterparty_node_id_arr = (*env)->NewByteArray(env, 33);
4180 (*env)->SetByteArrayRegion(env, counterparty_node_id_arr, 0, 33, obj->funding_generation_ready.counterparty_node_id.compressed_form);
4181 int64_t channel_value_satoshis_conv = obj->funding_generation_ready.channel_value_satoshis;
4182 LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script;
4183 int8_tArray output_script_arr = (*env)->NewByteArray(env, output_script_var.datalen);
4184 (*env)->SetByteArrayRegion(env, output_script_arr, 0, output_script_var.datalen, output_script_var.data);
4185 int8_tArray user_channel_id_arr = (*env)->NewByteArray(env, 16);
4186 (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, obj->funding_generation_ready.user_channel_id.le_bytes);
4187 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);
4189 case LDKEvent_PaymentClaimable: {
4190 int8_tArray receiver_node_id_arr = (*env)->NewByteArray(env, 33);
4191 (*env)->SetByteArrayRegion(env, receiver_node_id_arr, 0, 33, obj->payment_claimable.receiver_node_id.compressed_form);
4192 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
4193 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_claimable.payment_hash.data);
4194 LDKRecipientOnionFields onion_fields_var = obj->payment_claimable.onion_fields;
4195 int64_t onion_fields_ref = 0;
4196 CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_var);
4197 onion_fields_ref = tag_ptr(onion_fields_var.inner, false);
4198 int64_t amount_msat_conv = obj->payment_claimable.amount_msat;
4199 int64_t purpose_ref = tag_ptr(&obj->payment_claimable.purpose, false);
4200 int8_tArray via_channel_id_arr = (*env)->NewByteArray(env, 32);
4201 (*env)->SetByteArrayRegion(env, via_channel_id_arr, 0, 32, obj->payment_claimable.via_channel_id.data);
4202 int64_t via_user_channel_id_ref = tag_ptr(&obj->payment_claimable.via_user_channel_id, false);
4203 int64_t claim_deadline_ref = tag_ptr(&obj->payment_claimable.claim_deadline, false);
4204 return (*env)->NewObject(env, LDKEvent_PaymentClaimable_class, LDKEvent_PaymentClaimable_meth, receiver_node_id_arr, payment_hash_arr, onion_fields_ref, amount_msat_conv, purpose_ref, via_channel_id_arr, via_user_channel_id_ref, claim_deadline_ref);
4206 case LDKEvent_PaymentClaimed: {
4207 int8_tArray receiver_node_id_arr = (*env)->NewByteArray(env, 33);
4208 (*env)->SetByteArrayRegion(env, receiver_node_id_arr, 0, 33, obj->payment_claimed.receiver_node_id.compressed_form);
4209 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
4210 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_claimed.payment_hash.data);
4211 int64_t amount_msat_conv = obj->payment_claimed.amount_msat;
4212 int64_t purpose_ref = tag_ptr(&obj->payment_claimed.purpose, false);
4213 return (*env)->NewObject(env, LDKEvent_PaymentClaimed_class, LDKEvent_PaymentClaimed_meth, receiver_node_id_arr, payment_hash_arr, amount_msat_conv, purpose_ref);
4215 case LDKEvent_PaymentSent: {
4216 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
4217 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_sent.payment_id.data);
4218 int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
4219 (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->payment_sent.payment_preimage.data);
4220 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
4221 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_sent.payment_hash.data);
4222 int64_t fee_paid_msat_ref = tag_ptr(&obj->payment_sent.fee_paid_msat, false);
4223 return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_id_arr, payment_preimage_arr, payment_hash_arr, fee_paid_msat_ref);
4225 case LDKEvent_PaymentFailed: {
4226 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
4227 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_failed.payment_id.data);
4228 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
4229 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_failed.payment_hash.data);
4230 int64_t reason_ref = tag_ptr(&obj->payment_failed.reason, false);
4231 return (*env)->NewObject(env, LDKEvent_PaymentFailed_class, LDKEvent_PaymentFailed_meth, payment_id_arr, payment_hash_arr, reason_ref);
4233 case LDKEvent_PaymentPathSuccessful: {
4234 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
4235 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_successful.payment_id.data);
4236 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
4237 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_successful.payment_hash.data);
4238 LDKPath path_var = obj->payment_path_successful.path;
4239 int64_t path_ref = 0;
4240 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var);
4241 path_ref = tag_ptr(path_var.inner, false);
4242 return (*env)->NewObject(env, LDKEvent_PaymentPathSuccessful_class, LDKEvent_PaymentPathSuccessful_meth, payment_id_arr, payment_hash_arr, path_ref);
4244 case LDKEvent_PaymentPathFailed: {
4245 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
4246 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->payment_path_failed.payment_id.data);
4247 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
4248 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_path_failed.payment_hash.data);
4249 jboolean payment_failed_permanently_conv = obj->payment_path_failed.payment_failed_permanently;
4250 int64_t failure_ref = tag_ptr(&obj->payment_path_failed.failure, false);
4251 LDKPath path_var = obj->payment_path_failed.path;
4252 int64_t path_ref = 0;
4253 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var);
4254 path_ref = tag_ptr(path_var.inner, false);
4255 int64_t short_channel_id_ref = tag_ptr(&obj->payment_path_failed.short_channel_id, false);
4256 return (*env)->NewObject(env, LDKEvent_PaymentPathFailed_class, LDKEvent_PaymentPathFailed_meth, payment_id_arr, payment_hash_arr, payment_failed_permanently_conv, failure_ref, path_ref, short_channel_id_ref);
4258 case LDKEvent_ProbeSuccessful: {
4259 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
4260 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->probe_successful.payment_id.data);
4261 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
4262 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->probe_successful.payment_hash.data);
4263 LDKPath path_var = obj->probe_successful.path;
4264 int64_t path_ref = 0;
4265 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var);
4266 path_ref = tag_ptr(path_var.inner, false);
4267 return (*env)->NewObject(env, LDKEvent_ProbeSuccessful_class, LDKEvent_ProbeSuccessful_meth, payment_id_arr, payment_hash_arr, path_ref);
4269 case LDKEvent_ProbeFailed: {
4270 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
4271 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->probe_failed.payment_id.data);
4272 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
4273 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->probe_failed.payment_hash.data);
4274 LDKPath path_var = obj->probe_failed.path;
4275 int64_t path_ref = 0;
4276 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var);
4277 path_ref = tag_ptr(path_var.inner, false);
4278 int64_t short_channel_id_ref = tag_ptr(&obj->probe_failed.short_channel_id, false);
4279 return (*env)->NewObject(env, LDKEvent_ProbeFailed_class, LDKEvent_ProbeFailed_meth, payment_id_arr, payment_hash_arr, path_ref, short_channel_id_ref);
4281 case LDKEvent_PendingHTLCsForwardable: {
4282 int64_t time_forwardable_conv = obj->pending_htl_cs_forwardable.time_forwardable;
4283 return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, time_forwardable_conv);
4285 case LDKEvent_HTLCIntercepted: {
4286 int8_tArray intercept_id_arr = (*env)->NewByteArray(env, 32);
4287 (*env)->SetByteArrayRegion(env, intercept_id_arr, 0, 32, obj->htlc_intercepted.intercept_id.data);
4288 int64_t requested_next_hop_scid_conv = obj->htlc_intercepted.requested_next_hop_scid;
4289 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
4290 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->htlc_intercepted.payment_hash.data);
4291 int64_t inbound_amount_msat_conv = obj->htlc_intercepted.inbound_amount_msat;
4292 int64_t expected_outbound_amount_msat_conv = obj->htlc_intercepted.expected_outbound_amount_msat;
4293 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);
4295 case LDKEvent_SpendableOutputs: {
4296 LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs;
4297 int64_tArray outputs_arr = NULL;
4298 outputs_arr = (*env)->NewLongArray(env, outputs_var.datalen);
4299 int64_t *outputs_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, outputs_arr, NULL);
4300 for (size_t b = 0; b < outputs_var.datalen; b++) {
4301 int64_t outputs_conv_27_ref = tag_ptr(&outputs_var.data[b], false);
4302 outputs_arr_ptr[b] = outputs_conv_27_ref;
4304 (*env)->ReleasePrimitiveArrayCritical(env, outputs_arr, outputs_arr_ptr, 0);
4305 return (*env)->NewObject(env, LDKEvent_SpendableOutputs_class, LDKEvent_SpendableOutputs_meth, outputs_arr);
4307 case LDKEvent_PaymentForwarded: {
4308 int8_tArray prev_channel_id_arr = (*env)->NewByteArray(env, 32);
4309 (*env)->SetByteArrayRegion(env, prev_channel_id_arr, 0, 32, obj->payment_forwarded.prev_channel_id.data);
4310 int8_tArray next_channel_id_arr = (*env)->NewByteArray(env, 32);
4311 (*env)->SetByteArrayRegion(env, next_channel_id_arr, 0, 32, obj->payment_forwarded.next_channel_id.data);
4312 int64_t fee_earned_msat_ref = tag_ptr(&obj->payment_forwarded.fee_earned_msat, false);
4313 jboolean claim_from_onchain_tx_conv = obj->payment_forwarded.claim_from_onchain_tx;
4314 int64_t outbound_amount_forwarded_msat_ref = tag_ptr(&obj->payment_forwarded.outbound_amount_forwarded_msat, false);
4315 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, outbound_amount_forwarded_msat_ref);
4317 case LDKEvent_ChannelPending: {
4318 int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32);
4319 (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->channel_pending.channel_id.data);
4320 int8_tArray user_channel_id_arr = (*env)->NewByteArray(env, 16);
4321 (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, obj->channel_pending.user_channel_id.le_bytes);
4322 int8_tArray former_temporary_channel_id_arr = (*env)->NewByteArray(env, 32);
4323 (*env)->SetByteArrayRegion(env, former_temporary_channel_id_arr, 0, 32, obj->channel_pending.former_temporary_channel_id.data);
4324 int8_tArray counterparty_node_id_arr = (*env)->NewByteArray(env, 33);
4325 (*env)->SetByteArrayRegion(env, counterparty_node_id_arr, 0, 33, obj->channel_pending.counterparty_node_id.compressed_form);
4326 LDKOutPoint funding_txo_var = obj->channel_pending.funding_txo;
4327 int64_t funding_txo_ref = 0;
4328 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
4329 funding_txo_ref = tag_ptr(funding_txo_var.inner, false);
4330 return (*env)->NewObject(env, LDKEvent_ChannelPending_class, LDKEvent_ChannelPending_meth, channel_id_arr, user_channel_id_arr, former_temporary_channel_id_arr, counterparty_node_id_arr, funding_txo_ref);
4332 case LDKEvent_ChannelReady: {
4333 int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32);
4334 (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->channel_ready.channel_id.data);
4335 int8_tArray user_channel_id_arr = (*env)->NewByteArray(env, 16);
4336 (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, obj->channel_ready.user_channel_id.le_bytes);
4337 int8_tArray counterparty_node_id_arr = (*env)->NewByteArray(env, 33);
4338 (*env)->SetByteArrayRegion(env, counterparty_node_id_arr, 0, 33, obj->channel_ready.counterparty_node_id.compressed_form);
4339 LDKChannelTypeFeatures channel_type_var = obj->channel_ready.channel_type;
4340 int64_t channel_type_ref = 0;
4341 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var);
4342 channel_type_ref = tag_ptr(channel_type_var.inner, false);
4343 return (*env)->NewObject(env, LDKEvent_ChannelReady_class, LDKEvent_ChannelReady_meth, channel_id_arr, user_channel_id_arr, counterparty_node_id_arr, channel_type_ref);
4345 case LDKEvent_ChannelClosed: {
4346 int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32);
4347 (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->channel_closed.channel_id.data);
4348 int8_tArray user_channel_id_arr = (*env)->NewByteArray(env, 16);
4349 (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, obj->channel_closed.user_channel_id.le_bytes);
4350 int64_t reason_ref = tag_ptr(&obj->channel_closed.reason, false);
4351 return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_arr, user_channel_id_arr, reason_ref);
4353 case LDKEvent_DiscardFunding: {
4354 int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32);
4355 (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->discard_funding.channel_id.data);
4356 LDKTransaction transaction_var = obj->discard_funding.transaction;
4357 int8_tArray transaction_arr = (*env)->NewByteArray(env, transaction_var.datalen);
4358 (*env)->SetByteArrayRegion(env, transaction_arr, 0, transaction_var.datalen, transaction_var.data);
4359 return (*env)->NewObject(env, LDKEvent_DiscardFunding_class, LDKEvent_DiscardFunding_meth, channel_id_arr, transaction_arr);
4361 case LDKEvent_OpenChannelRequest: {
4362 int8_tArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32);
4363 (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->open_channel_request.temporary_channel_id.data);
4364 int8_tArray counterparty_node_id_arr = (*env)->NewByteArray(env, 33);
4365 (*env)->SetByteArrayRegion(env, counterparty_node_id_arr, 0, 33, obj->open_channel_request.counterparty_node_id.compressed_form);
4366 int64_t funding_satoshis_conv = obj->open_channel_request.funding_satoshis;
4367 int64_t push_msat_conv = obj->open_channel_request.push_msat;
4368 LDKChannelTypeFeatures channel_type_var = obj->open_channel_request.channel_type;
4369 int64_t channel_type_ref = 0;
4370 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var);
4371 channel_type_ref = tag_ptr(channel_type_var.inner, false);
4372 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);
4374 case LDKEvent_HTLCHandlingFailed: {
4375 int8_tArray prev_channel_id_arr = (*env)->NewByteArray(env, 32);
4376 (*env)->SetByteArrayRegion(env, prev_channel_id_arr, 0, 32, obj->htlc_handling_failed.prev_channel_id.data);
4377 int64_t failed_next_destination_ref = tag_ptr(&obj->htlc_handling_failed.failed_next_destination, false);
4378 return (*env)->NewObject(env, LDKEvent_HTLCHandlingFailed_class, LDKEvent_HTLCHandlingFailed_meth, prev_channel_id_arr, failed_next_destination_ref);
4383 static jclass LDKCOption_EventZ_Some_class = NULL;
4384 static jmethodID LDKCOption_EventZ_Some_meth = NULL;
4385 static jclass LDKCOption_EventZ_None_class = NULL;
4386 static jmethodID LDKCOption_EventZ_None_meth = NULL;
4387 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1EventZ_init (JNIEnv *env, jclass clz) {
4388 LDKCOption_EventZ_Some_class =
4389 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_EventZ$Some"));
4390 CHECK(LDKCOption_EventZ_Some_class != NULL);
4391 LDKCOption_EventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_Some_class, "<init>", "(J)V");
4392 CHECK(LDKCOption_EventZ_Some_meth != NULL);
4393 LDKCOption_EventZ_None_class =
4394 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_EventZ$None"));
4395 CHECK(LDKCOption_EventZ_None_class != NULL);
4396 LDKCOption_EventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_EventZ_None_class, "<init>", "()V");
4397 CHECK(LDKCOption_EventZ_None_meth != NULL);
4399 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1EventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
4400 LDKCOption_EventZ *obj = (LDKCOption_EventZ*)untag_ptr(ptr);
4402 case LDKCOption_EventZ_Some: {
4403 int64_t some_ref = tag_ptr(&obj->some, false);
4404 return (*env)->NewObject(env, LDKCOption_EventZ_Some_class, LDKCOption_EventZ_Some_meth, some_ref);
4406 case LDKCOption_EventZ_None: {
4407 return (*env)->NewObject(env, LDKCOption_EventZ_None_class, LDKCOption_EventZ_None_meth);
4412 static inline struct LDKCOption_EventZ CResult_COption_EventZDecodeErrorZ_get_ok(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
4413 CHECK(owner->result_ok);
4414 return COption_EventZ_clone(&*owner->contents.result);
4416 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4417 LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
4418 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
4419 *ret_copy = CResult_COption_EventZDecodeErrorZ_get_ok(owner_conv);
4420 int64_t ret_ref = tag_ptr(ret_copy, true);
4424 static inline struct LDKDecodeError CResult_COption_EventZDecodeErrorZ_get_err(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
4425 CHECK(!owner->result_ok);
4426 return DecodeError_clone(&*owner->contents.err);
4428 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4429 LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
4430 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4431 *ret_copy = CResult_COption_EventZDecodeErrorZ_get_err(owner_conv);
4432 int64_t ret_ref = tag_ptr(ret_copy, true);
4436 static jclass LDKErrorAction_DisconnectPeer_class = NULL;
4437 static jmethodID LDKErrorAction_DisconnectPeer_meth = NULL;
4438 static jclass LDKErrorAction_IgnoreError_class = NULL;
4439 static jmethodID LDKErrorAction_IgnoreError_meth = NULL;
4440 static jclass LDKErrorAction_IgnoreAndLog_class = NULL;
4441 static jmethodID LDKErrorAction_IgnoreAndLog_meth = NULL;
4442 static jclass LDKErrorAction_IgnoreDuplicateGossip_class = NULL;
4443 static jmethodID LDKErrorAction_IgnoreDuplicateGossip_meth = NULL;
4444 static jclass LDKErrorAction_SendErrorMessage_class = NULL;
4445 static jmethodID LDKErrorAction_SendErrorMessage_meth = NULL;
4446 static jclass LDKErrorAction_SendWarningMessage_class = NULL;
4447 static jmethodID LDKErrorAction_SendWarningMessage_meth = NULL;
4448 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKErrorAction_init (JNIEnv *env, jclass clz) {
4449 LDKErrorAction_DisconnectPeer_class =
4450 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$DisconnectPeer"));
4451 CHECK(LDKErrorAction_DisconnectPeer_class != NULL);
4452 LDKErrorAction_DisconnectPeer_meth = (*env)->GetMethodID(env, LDKErrorAction_DisconnectPeer_class, "<init>", "(J)V");
4453 CHECK(LDKErrorAction_DisconnectPeer_meth != NULL);
4454 LDKErrorAction_IgnoreError_class =
4455 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$IgnoreError"));
4456 CHECK(LDKErrorAction_IgnoreError_class != NULL);
4457 LDKErrorAction_IgnoreError_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreError_class, "<init>", "()V");
4458 CHECK(LDKErrorAction_IgnoreError_meth != NULL);
4459 LDKErrorAction_IgnoreAndLog_class =
4460 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$IgnoreAndLog"));
4461 CHECK(LDKErrorAction_IgnoreAndLog_class != NULL);
4462 LDKErrorAction_IgnoreAndLog_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreAndLog_class, "<init>", "(Lorg/ldk/enums/Level;)V");
4463 CHECK(LDKErrorAction_IgnoreAndLog_meth != NULL);
4464 LDKErrorAction_IgnoreDuplicateGossip_class =
4465 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$IgnoreDuplicateGossip"));
4466 CHECK(LDKErrorAction_IgnoreDuplicateGossip_class != NULL);
4467 LDKErrorAction_IgnoreDuplicateGossip_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreDuplicateGossip_class, "<init>", "()V");
4468 CHECK(LDKErrorAction_IgnoreDuplicateGossip_meth != NULL);
4469 LDKErrorAction_SendErrorMessage_class =
4470 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$SendErrorMessage"));
4471 CHECK(LDKErrorAction_SendErrorMessage_class != NULL);
4472 LDKErrorAction_SendErrorMessage_meth = (*env)->GetMethodID(env, LDKErrorAction_SendErrorMessage_class, "<init>", "(J)V");
4473 CHECK(LDKErrorAction_SendErrorMessage_meth != NULL);
4474 LDKErrorAction_SendWarningMessage_class =
4475 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKErrorAction$SendWarningMessage"));
4476 CHECK(LDKErrorAction_SendWarningMessage_class != NULL);
4477 LDKErrorAction_SendWarningMessage_meth = (*env)->GetMethodID(env, LDKErrorAction_SendWarningMessage_class, "<init>", "(JLorg/ldk/enums/Level;)V");
4478 CHECK(LDKErrorAction_SendWarningMessage_meth != NULL);
4480 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
4481 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
4483 case LDKErrorAction_DisconnectPeer: {
4484 LDKErrorMessage msg_var = obj->disconnect_peer.msg;
4485 int64_t msg_ref = 0;
4486 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4487 msg_ref = tag_ptr(msg_var.inner, false);
4488 return (*env)->NewObject(env, LDKErrorAction_DisconnectPeer_class, LDKErrorAction_DisconnectPeer_meth, msg_ref);
4490 case LDKErrorAction_IgnoreError: {
4491 return (*env)->NewObject(env, LDKErrorAction_IgnoreError_class, LDKErrorAction_IgnoreError_meth);
4493 case LDKErrorAction_IgnoreAndLog: {
4494 jclass ignore_and_log_conv = LDKLevel_to_java(env, obj->ignore_and_log);
4495 return (*env)->NewObject(env, LDKErrorAction_IgnoreAndLog_class, LDKErrorAction_IgnoreAndLog_meth, ignore_and_log_conv);
4497 case LDKErrorAction_IgnoreDuplicateGossip: {
4498 return (*env)->NewObject(env, LDKErrorAction_IgnoreDuplicateGossip_class, LDKErrorAction_IgnoreDuplicateGossip_meth);
4500 case LDKErrorAction_SendErrorMessage: {
4501 LDKErrorMessage msg_var = obj->send_error_message.msg;
4502 int64_t msg_ref = 0;
4503 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4504 msg_ref = tag_ptr(msg_var.inner, false);
4505 return (*env)->NewObject(env, LDKErrorAction_SendErrorMessage_class, LDKErrorAction_SendErrorMessage_meth, msg_ref);
4507 case LDKErrorAction_SendWarningMessage: {
4508 LDKWarningMessage msg_var = obj->send_warning_message.msg;
4509 int64_t msg_ref = 0;
4510 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4511 msg_ref = tag_ptr(msg_var.inner, false);
4512 jclass log_level_conv = LDKLevel_to_java(env, obj->send_warning_message.log_level);
4513 return (*env)->NewObject(env, LDKErrorAction_SendWarningMessage_class, LDKErrorAction_SendWarningMessage_meth, msg_ref, log_level_conv);
4518 static jclass LDKMessageSendEvent_SendAcceptChannel_class = NULL;
4519 static jmethodID LDKMessageSendEvent_SendAcceptChannel_meth = NULL;
4520 static jclass LDKMessageSendEvent_SendOpenChannel_class = NULL;
4521 static jmethodID LDKMessageSendEvent_SendOpenChannel_meth = NULL;
4522 static jclass LDKMessageSendEvent_SendFundingCreated_class = NULL;
4523 static jmethodID LDKMessageSendEvent_SendFundingCreated_meth = NULL;
4524 static jclass LDKMessageSendEvent_SendFundingSigned_class = NULL;
4525 static jmethodID LDKMessageSendEvent_SendFundingSigned_meth = NULL;
4526 static jclass LDKMessageSendEvent_SendChannelReady_class = NULL;
4527 static jmethodID LDKMessageSendEvent_SendChannelReady_meth = NULL;
4528 static jclass LDKMessageSendEvent_SendAnnouncementSignatures_class = NULL;
4529 static jmethodID LDKMessageSendEvent_SendAnnouncementSignatures_meth = NULL;
4530 static jclass LDKMessageSendEvent_UpdateHTLCs_class = NULL;
4531 static jmethodID LDKMessageSendEvent_UpdateHTLCs_meth = NULL;
4532 static jclass LDKMessageSendEvent_SendRevokeAndACK_class = NULL;
4533 static jmethodID LDKMessageSendEvent_SendRevokeAndACK_meth = NULL;
4534 static jclass LDKMessageSendEvent_SendClosingSigned_class = NULL;
4535 static jmethodID LDKMessageSendEvent_SendClosingSigned_meth = NULL;
4536 static jclass LDKMessageSendEvent_SendShutdown_class = NULL;
4537 static jmethodID LDKMessageSendEvent_SendShutdown_meth = NULL;
4538 static jclass LDKMessageSendEvent_SendChannelReestablish_class = NULL;
4539 static jmethodID LDKMessageSendEvent_SendChannelReestablish_meth = NULL;
4540 static jclass LDKMessageSendEvent_SendChannelAnnouncement_class = NULL;
4541 static jmethodID LDKMessageSendEvent_SendChannelAnnouncement_meth = NULL;
4542 static jclass LDKMessageSendEvent_BroadcastChannelAnnouncement_class = NULL;
4543 static jmethodID LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = NULL;
4544 static jclass LDKMessageSendEvent_BroadcastChannelUpdate_class = NULL;
4545 static jmethodID LDKMessageSendEvent_BroadcastChannelUpdate_meth = NULL;
4546 static jclass LDKMessageSendEvent_BroadcastNodeAnnouncement_class = NULL;
4547 static jmethodID LDKMessageSendEvent_BroadcastNodeAnnouncement_meth = NULL;
4548 static jclass LDKMessageSendEvent_SendChannelUpdate_class = NULL;
4549 static jmethodID LDKMessageSendEvent_SendChannelUpdate_meth = NULL;
4550 static jclass LDKMessageSendEvent_HandleError_class = NULL;
4551 static jmethodID LDKMessageSendEvent_HandleError_meth = NULL;
4552 static jclass LDKMessageSendEvent_SendChannelRangeQuery_class = NULL;
4553 static jmethodID LDKMessageSendEvent_SendChannelRangeQuery_meth = NULL;
4554 static jclass LDKMessageSendEvent_SendShortIdsQuery_class = NULL;
4555 static jmethodID LDKMessageSendEvent_SendShortIdsQuery_meth = NULL;
4556 static jclass LDKMessageSendEvent_SendReplyChannelRange_class = NULL;
4557 static jmethodID LDKMessageSendEvent_SendReplyChannelRange_meth = NULL;
4558 static jclass LDKMessageSendEvent_SendGossipTimestampFilter_class = NULL;
4559 static jmethodID LDKMessageSendEvent_SendGossipTimestampFilter_meth = NULL;
4560 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_init (JNIEnv *env, jclass clz) {
4561 LDKMessageSendEvent_SendAcceptChannel_class =
4562 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendAcceptChannel"));
4563 CHECK(LDKMessageSendEvent_SendAcceptChannel_class != NULL);
4564 LDKMessageSendEvent_SendAcceptChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAcceptChannel_class, "<init>", "([BJ)V");
4565 CHECK(LDKMessageSendEvent_SendAcceptChannel_meth != NULL);
4566 LDKMessageSendEvent_SendOpenChannel_class =
4567 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendOpenChannel"));
4568 CHECK(LDKMessageSendEvent_SendOpenChannel_class != NULL);
4569 LDKMessageSendEvent_SendOpenChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendOpenChannel_class, "<init>", "([BJ)V");
4570 CHECK(LDKMessageSendEvent_SendOpenChannel_meth != NULL);
4571 LDKMessageSendEvent_SendFundingCreated_class =
4572 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendFundingCreated"));
4573 CHECK(LDKMessageSendEvent_SendFundingCreated_class != NULL);
4574 LDKMessageSendEvent_SendFundingCreated_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingCreated_class, "<init>", "([BJ)V");
4575 CHECK(LDKMessageSendEvent_SendFundingCreated_meth != NULL);
4576 LDKMessageSendEvent_SendFundingSigned_class =
4577 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendFundingSigned"));
4578 CHECK(LDKMessageSendEvent_SendFundingSigned_class != NULL);
4579 LDKMessageSendEvent_SendFundingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingSigned_class, "<init>", "([BJ)V");
4580 CHECK(LDKMessageSendEvent_SendFundingSigned_meth != NULL);
4581 LDKMessageSendEvent_SendChannelReady_class =
4582 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelReady"));
4583 CHECK(LDKMessageSendEvent_SendChannelReady_class != NULL);
4584 LDKMessageSendEvent_SendChannelReady_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelReady_class, "<init>", "([BJ)V");
4585 CHECK(LDKMessageSendEvent_SendChannelReady_meth != NULL);
4586 LDKMessageSendEvent_SendAnnouncementSignatures_class =
4587 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendAnnouncementSignatures"));
4588 CHECK(LDKMessageSendEvent_SendAnnouncementSignatures_class != NULL);
4589 LDKMessageSendEvent_SendAnnouncementSignatures_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, "<init>", "([BJ)V");
4590 CHECK(LDKMessageSendEvent_SendAnnouncementSignatures_meth != NULL);
4591 LDKMessageSendEvent_UpdateHTLCs_class =
4592 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$UpdateHTLCs"));
4593 CHECK(LDKMessageSendEvent_UpdateHTLCs_class != NULL);
4594 LDKMessageSendEvent_UpdateHTLCs_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_UpdateHTLCs_class, "<init>", "([BJ)V");
4595 CHECK(LDKMessageSendEvent_UpdateHTLCs_meth != NULL);
4596 LDKMessageSendEvent_SendRevokeAndACK_class =
4597 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendRevokeAndACK"));
4598 CHECK(LDKMessageSendEvent_SendRevokeAndACK_class != NULL);
4599 LDKMessageSendEvent_SendRevokeAndACK_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendRevokeAndACK_class, "<init>", "([BJ)V");
4600 CHECK(LDKMessageSendEvent_SendRevokeAndACK_meth != NULL);
4601 LDKMessageSendEvent_SendClosingSigned_class =
4602 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendClosingSigned"));
4603 CHECK(LDKMessageSendEvent_SendClosingSigned_class != NULL);
4604 LDKMessageSendEvent_SendClosingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendClosingSigned_class, "<init>", "([BJ)V");
4605 CHECK(LDKMessageSendEvent_SendClosingSigned_meth != NULL);
4606 LDKMessageSendEvent_SendShutdown_class =
4607 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendShutdown"));
4608 CHECK(LDKMessageSendEvent_SendShutdown_class != NULL);
4609 LDKMessageSendEvent_SendShutdown_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendShutdown_class, "<init>", "([BJ)V");
4610 CHECK(LDKMessageSendEvent_SendShutdown_meth != NULL);
4611 LDKMessageSendEvent_SendChannelReestablish_class =
4612 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelReestablish"));
4613 CHECK(LDKMessageSendEvent_SendChannelReestablish_class != NULL);
4614 LDKMessageSendEvent_SendChannelReestablish_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelReestablish_class, "<init>", "([BJ)V");
4615 CHECK(LDKMessageSendEvent_SendChannelReestablish_meth != NULL);
4616 LDKMessageSendEvent_SendChannelAnnouncement_class =
4617 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelAnnouncement"));
4618 CHECK(LDKMessageSendEvent_SendChannelAnnouncement_class != NULL);
4619 LDKMessageSendEvent_SendChannelAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelAnnouncement_class, "<init>", "([BJJ)V");
4620 CHECK(LDKMessageSendEvent_SendChannelAnnouncement_meth != NULL);
4621 LDKMessageSendEvent_BroadcastChannelAnnouncement_class =
4622 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelAnnouncement"));
4623 CHECK(LDKMessageSendEvent_BroadcastChannelAnnouncement_class != NULL);
4624 LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, "<init>", "(JJ)V");
4625 CHECK(LDKMessageSendEvent_BroadcastChannelAnnouncement_meth != NULL);
4626 LDKMessageSendEvent_BroadcastChannelUpdate_class =
4627 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelUpdate"));
4628 CHECK(LDKMessageSendEvent_BroadcastChannelUpdate_class != NULL);
4629 LDKMessageSendEvent_BroadcastChannelUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, "<init>", "(J)V");
4630 CHECK(LDKMessageSendEvent_BroadcastChannelUpdate_meth != NULL);
4631 LDKMessageSendEvent_BroadcastNodeAnnouncement_class =
4632 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$BroadcastNodeAnnouncement"));
4633 CHECK(LDKMessageSendEvent_BroadcastNodeAnnouncement_class != NULL);
4634 LDKMessageSendEvent_BroadcastNodeAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, "<init>", "(J)V");
4635 CHECK(LDKMessageSendEvent_BroadcastNodeAnnouncement_meth != NULL);
4636 LDKMessageSendEvent_SendChannelUpdate_class =
4637 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelUpdate"));
4638 CHECK(LDKMessageSendEvent_SendChannelUpdate_class != NULL);
4639 LDKMessageSendEvent_SendChannelUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelUpdate_class, "<init>", "([BJ)V");
4640 CHECK(LDKMessageSendEvent_SendChannelUpdate_meth != NULL);
4641 LDKMessageSendEvent_HandleError_class =
4642 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$HandleError"));
4643 CHECK(LDKMessageSendEvent_HandleError_class != NULL);
4644 LDKMessageSendEvent_HandleError_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_HandleError_class, "<init>", "([BJ)V");
4645 CHECK(LDKMessageSendEvent_HandleError_meth != NULL);
4646 LDKMessageSendEvent_SendChannelRangeQuery_class =
4647 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendChannelRangeQuery"));
4648 CHECK(LDKMessageSendEvent_SendChannelRangeQuery_class != NULL);
4649 LDKMessageSendEvent_SendChannelRangeQuery_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelRangeQuery_class, "<init>", "([BJ)V");
4650 CHECK(LDKMessageSendEvent_SendChannelRangeQuery_meth != NULL);
4651 LDKMessageSendEvent_SendShortIdsQuery_class =
4652 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendShortIdsQuery"));
4653 CHECK(LDKMessageSendEvent_SendShortIdsQuery_class != NULL);
4654 LDKMessageSendEvent_SendShortIdsQuery_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendShortIdsQuery_class, "<init>", "([BJ)V");
4655 CHECK(LDKMessageSendEvent_SendShortIdsQuery_meth != NULL);
4656 LDKMessageSendEvent_SendReplyChannelRange_class =
4657 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendReplyChannelRange"));
4658 CHECK(LDKMessageSendEvent_SendReplyChannelRange_class != NULL);
4659 LDKMessageSendEvent_SendReplyChannelRange_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendReplyChannelRange_class, "<init>", "([BJ)V");
4660 CHECK(LDKMessageSendEvent_SendReplyChannelRange_meth != NULL);
4661 LDKMessageSendEvent_SendGossipTimestampFilter_class =
4662 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMessageSendEvent$SendGossipTimestampFilter"));
4663 CHECK(LDKMessageSendEvent_SendGossipTimestampFilter_class != NULL);
4664 LDKMessageSendEvent_SendGossipTimestampFilter_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendGossipTimestampFilter_class, "<init>", "([BJ)V");
4665 CHECK(LDKMessageSendEvent_SendGossipTimestampFilter_meth != NULL);
4667 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
4668 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
4670 case LDKMessageSendEvent_SendAcceptChannel: {
4671 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4672 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_accept_channel.node_id.compressed_form);
4673 LDKAcceptChannel msg_var = obj->send_accept_channel.msg;
4674 int64_t msg_ref = 0;
4675 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4676 msg_ref = tag_ptr(msg_var.inner, false);
4677 return (*env)->NewObject(env, LDKMessageSendEvent_SendAcceptChannel_class, LDKMessageSendEvent_SendAcceptChannel_meth, node_id_arr, msg_ref);
4679 case LDKMessageSendEvent_SendOpenChannel: {
4680 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4681 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_open_channel.node_id.compressed_form);
4682 LDKOpenChannel msg_var = obj->send_open_channel.msg;
4683 int64_t msg_ref = 0;
4684 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4685 msg_ref = tag_ptr(msg_var.inner, false);
4686 return (*env)->NewObject(env, LDKMessageSendEvent_SendOpenChannel_class, LDKMessageSendEvent_SendOpenChannel_meth, node_id_arr, msg_ref);
4688 case LDKMessageSendEvent_SendFundingCreated: {
4689 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4690 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_funding_created.node_id.compressed_form);
4691 LDKFundingCreated msg_var = obj->send_funding_created.msg;
4692 int64_t msg_ref = 0;
4693 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4694 msg_ref = tag_ptr(msg_var.inner, false);
4695 return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingCreated_class, LDKMessageSendEvent_SendFundingCreated_meth, node_id_arr, msg_ref);
4697 case LDKMessageSendEvent_SendFundingSigned: {
4698 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4699 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_funding_signed.node_id.compressed_form);
4700 LDKFundingSigned msg_var = obj->send_funding_signed.msg;
4701 int64_t msg_ref = 0;
4702 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4703 msg_ref = tag_ptr(msg_var.inner, false);
4704 return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingSigned_class, LDKMessageSendEvent_SendFundingSigned_meth, node_id_arr, msg_ref);
4706 case LDKMessageSendEvent_SendChannelReady: {
4707 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4708 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_ready.node_id.compressed_form);
4709 LDKChannelReady msg_var = obj->send_channel_ready.msg;
4710 int64_t msg_ref = 0;
4711 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4712 msg_ref = tag_ptr(msg_var.inner, false);
4713 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelReady_class, LDKMessageSendEvent_SendChannelReady_meth, node_id_arr, msg_ref);
4715 case LDKMessageSendEvent_SendAnnouncementSignatures: {
4716 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4717 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_announcement_signatures.node_id.compressed_form);
4718 LDKAnnouncementSignatures msg_var = obj->send_announcement_signatures.msg;
4719 int64_t msg_ref = 0;
4720 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4721 msg_ref = tag_ptr(msg_var.inner, false);
4722 return (*env)->NewObject(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, LDKMessageSendEvent_SendAnnouncementSignatures_meth, node_id_arr, msg_ref);
4724 case LDKMessageSendEvent_UpdateHTLCs: {
4725 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4726 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->update_htl_cs.node_id.compressed_form);
4727 LDKCommitmentUpdate updates_var = obj->update_htl_cs.updates;
4728 int64_t updates_ref = 0;
4729 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_var);
4730 updates_ref = tag_ptr(updates_var.inner, false);
4731 return (*env)->NewObject(env, LDKMessageSendEvent_UpdateHTLCs_class, LDKMessageSendEvent_UpdateHTLCs_meth, node_id_arr, updates_ref);
4733 case LDKMessageSendEvent_SendRevokeAndACK: {
4734 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4735 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_revoke_and_ack.node_id.compressed_form);
4736 LDKRevokeAndACK msg_var = obj->send_revoke_and_ack.msg;
4737 int64_t msg_ref = 0;
4738 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4739 msg_ref = tag_ptr(msg_var.inner, false);
4740 return (*env)->NewObject(env, LDKMessageSendEvent_SendRevokeAndACK_class, LDKMessageSendEvent_SendRevokeAndACK_meth, node_id_arr, msg_ref);
4742 case LDKMessageSendEvent_SendClosingSigned: {
4743 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4744 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_closing_signed.node_id.compressed_form);
4745 LDKClosingSigned msg_var = obj->send_closing_signed.msg;
4746 int64_t msg_ref = 0;
4747 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4748 msg_ref = tag_ptr(msg_var.inner, false);
4749 return (*env)->NewObject(env, LDKMessageSendEvent_SendClosingSigned_class, LDKMessageSendEvent_SendClosingSigned_meth, node_id_arr, msg_ref);
4751 case LDKMessageSendEvent_SendShutdown: {
4752 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4753 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_shutdown.node_id.compressed_form);
4754 LDKShutdown msg_var = obj->send_shutdown.msg;
4755 int64_t msg_ref = 0;
4756 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4757 msg_ref = tag_ptr(msg_var.inner, false);
4758 return (*env)->NewObject(env, LDKMessageSendEvent_SendShutdown_class, LDKMessageSendEvent_SendShutdown_meth, node_id_arr, msg_ref);
4760 case LDKMessageSendEvent_SendChannelReestablish: {
4761 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4762 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_reestablish.node_id.compressed_form);
4763 LDKChannelReestablish msg_var = obj->send_channel_reestablish.msg;
4764 int64_t msg_ref = 0;
4765 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4766 msg_ref = tag_ptr(msg_var.inner, false);
4767 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelReestablish_class, LDKMessageSendEvent_SendChannelReestablish_meth, node_id_arr, msg_ref);
4769 case LDKMessageSendEvent_SendChannelAnnouncement: {
4770 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4771 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_announcement.node_id.compressed_form);
4772 LDKChannelAnnouncement msg_var = obj->send_channel_announcement.msg;
4773 int64_t msg_ref = 0;
4774 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4775 msg_ref = tag_ptr(msg_var.inner, false);
4776 LDKChannelUpdate update_msg_var = obj->send_channel_announcement.update_msg;
4777 int64_t update_msg_ref = 0;
4778 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var);
4779 update_msg_ref = tag_ptr(update_msg_var.inner, false);
4780 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelAnnouncement_class, LDKMessageSendEvent_SendChannelAnnouncement_meth, node_id_arr, msg_ref, update_msg_ref);
4782 case LDKMessageSendEvent_BroadcastChannelAnnouncement: {
4783 LDKChannelAnnouncement msg_var = obj->broadcast_channel_announcement.msg;
4784 int64_t msg_ref = 0;
4785 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4786 msg_ref = tag_ptr(msg_var.inner, false);
4787 LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg;
4788 int64_t update_msg_ref = 0;
4789 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var);
4790 update_msg_ref = tag_ptr(update_msg_var.inner, false);
4791 return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, LDKMessageSendEvent_BroadcastChannelAnnouncement_meth, msg_ref, update_msg_ref);
4793 case LDKMessageSendEvent_BroadcastChannelUpdate: {
4794 LDKChannelUpdate msg_var = obj->broadcast_channel_update.msg;
4795 int64_t msg_ref = 0;
4796 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4797 msg_ref = tag_ptr(msg_var.inner, false);
4798 return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, LDKMessageSendEvent_BroadcastChannelUpdate_meth, msg_ref);
4800 case LDKMessageSendEvent_BroadcastNodeAnnouncement: {
4801 LDKNodeAnnouncement msg_var = obj->broadcast_node_announcement.msg;
4802 int64_t msg_ref = 0;
4803 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4804 msg_ref = tag_ptr(msg_var.inner, false);
4805 return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, LDKMessageSendEvent_BroadcastNodeAnnouncement_meth, msg_ref);
4807 case LDKMessageSendEvent_SendChannelUpdate: {
4808 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4809 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_update.node_id.compressed_form);
4810 LDKChannelUpdate msg_var = obj->send_channel_update.msg;
4811 int64_t msg_ref = 0;
4812 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4813 msg_ref = tag_ptr(msg_var.inner, false);
4814 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelUpdate_class, LDKMessageSendEvent_SendChannelUpdate_meth, node_id_arr, msg_ref);
4816 case LDKMessageSendEvent_HandleError: {
4817 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4818 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->handle_error.node_id.compressed_form);
4819 int64_t action_ref = tag_ptr(&obj->handle_error.action, false);
4820 return (*env)->NewObject(env, LDKMessageSendEvent_HandleError_class, LDKMessageSendEvent_HandleError_meth, node_id_arr, action_ref);
4822 case LDKMessageSendEvent_SendChannelRangeQuery: {
4823 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4824 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_channel_range_query.node_id.compressed_form);
4825 LDKQueryChannelRange msg_var = obj->send_channel_range_query.msg;
4826 int64_t msg_ref = 0;
4827 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4828 msg_ref = tag_ptr(msg_var.inner, false);
4829 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelRangeQuery_class, LDKMessageSendEvent_SendChannelRangeQuery_meth, node_id_arr, msg_ref);
4831 case LDKMessageSendEvent_SendShortIdsQuery: {
4832 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4833 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_short_ids_query.node_id.compressed_form);
4834 LDKQueryShortChannelIds msg_var = obj->send_short_ids_query.msg;
4835 int64_t msg_ref = 0;
4836 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4837 msg_ref = tag_ptr(msg_var.inner, false);
4838 return (*env)->NewObject(env, LDKMessageSendEvent_SendShortIdsQuery_class, LDKMessageSendEvent_SendShortIdsQuery_meth, node_id_arr, msg_ref);
4840 case LDKMessageSendEvent_SendReplyChannelRange: {
4841 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4842 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_reply_channel_range.node_id.compressed_form);
4843 LDKReplyChannelRange msg_var = obj->send_reply_channel_range.msg;
4844 int64_t msg_ref = 0;
4845 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4846 msg_ref = tag_ptr(msg_var.inner, false);
4847 return (*env)->NewObject(env, LDKMessageSendEvent_SendReplyChannelRange_class, LDKMessageSendEvent_SendReplyChannelRange_meth, node_id_arr, msg_ref);
4849 case LDKMessageSendEvent_SendGossipTimestampFilter: {
4850 int8_tArray node_id_arr = (*env)->NewByteArray(env, 33);
4851 (*env)->SetByteArrayRegion(env, node_id_arr, 0, 33, obj->send_gossip_timestamp_filter.node_id.compressed_form);
4852 LDKGossipTimestampFilter msg_var = obj->send_gossip_timestamp_filter.msg;
4853 int64_t msg_ref = 0;
4854 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
4855 msg_ref = tag_ptr(msg_var.inner, false);
4856 return (*env)->NewObject(env, LDKMessageSendEvent_SendGossipTimestampFilter_class, LDKMessageSendEvent_SendGossipTimestampFilter_meth, node_id_arr, msg_ref);
4861 static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCVec_MessageSendEventZ *orig) {
4862 LDKCVec_MessageSendEventZ ret = { .data = MALLOC(sizeof(LDKMessageSendEvent) * orig->datalen, "LDKCVec_MessageSendEventZ clone bytes"), .datalen = orig->datalen };
4863 for (size_t i = 0; i < ret.datalen; i++) {
4864 ret.data[i] = MessageSendEvent_clone(&orig->data[i]);
4868 static inline LDKCVec_ChainHashZ CVec_ChainHashZ_clone(const LDKCVec_ChainHashZ *orig) {
4869 LDKCVec_ChainHashZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_ChainHashZ clone bytes"), .datalen = orig->datalen };
4870 for (size_t i = 0; i < ret.datalen; i++) {
4871 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
4875 static inline struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
4876 CHECK(owner->result_ok);
4877 return *owner->contents.result;
4879 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4880 LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
4881 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
4882 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, CResult_PublicKeyErrorZ_get_ok(owner_conv).compressed_form);
4886 static inline enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
4887 CHECK(!owner->result_ok);
4888 return *owner->contents.err;
4890 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4891 LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
4892 jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_PublicKeyErrorZ_get_err(owner_conv));
4896 static inline struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
4897 LDKNodeId ret = *owner->contents.result;
4898 ret.is_owned = false;
4901 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4902 LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
4903 LDKNodeId ret_var = CResult_NodeIdDecodeErrorZ_get_ok(owner_conv);
4904 int64_t ret_ref = 0;
4905 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4906 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4910 static inline struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
4911 CHECK(!owner->result_ok);
4912 return DecodeError_clone(&*owner->contents.err);
4914 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4915 LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
4916 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4917 *ret_copy = CResult_NodeIdDecodeErrorZ_get_err(owner_conv);
4918 int64_t ret_ref = tag_ptr(ret_copy, true);
4922 static inline struct LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
4923 CHECK(owner->result_ok);
4924 return COption_NetworkUpdateZ_clone(&*owner->contents.result);
4926 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4927 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
4928 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
4929 *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(owner_conv);
4930 int64_t ret_ref = tag_ptr(ret_copy, true);
4934 static inline struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
4935 CHECK(!owner->result_ok);
4936 return DecodeError_clone(&*owner->contents.err);
4938 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4939 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
4940 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
4941 *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv);
4942 int64_t ret_ref = tag_ptr(ret_copy, true);
4946 static inline struct LDKTxOut CResult_TxOutUtxoLookupErrorZ_get_ok(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR owner){
4947 CHECK(owner->result_ok);
4948 return TxOut_clone(&*owner->contents.result);
4950 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
4951 LDKCResult_TxOutUtxoLookupErrorZ* owner_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(owner);
4952 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
4953 *ret_ref = CResult_TxOutUtxoLookupErrorZ_get_ok(owner_conv);
4954 return tag_ptr(ret_ref, true);
4957 static inline enum LDKUtxoLookupError CResult_TxOutUtxoLookupErrorZ_get_err(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR owner){
4958 CHECK(!owner->result_ok);
4959 return UtxoLookupError_clone(&*owner->contents.err);
4961 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
4962 LDKCResult_TxOutUtxoLookupErrorZ* owner_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(owner);
4963 jclass ret_conv = LDKUtxoLookupError_to_java(env, CResult_TxOutUtxoLookupErrorZ_get_err(owner_conv));
4967 static jclass LDKUtxoResult_Sync_class = NULL;
4968 static jmethodID LDKUtxoResult_Sync_meth = NULL;
4969 static jclass LDKUtxoResult_Async_class = NULL;
4970 static jmethodID LDKUtxoResult_Async_meth = NULL;
4971 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKUtxoResult_init (JNIEnv *env, jclass clz) {
4972 LDKUtxoResult_Sync_class =
4973 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKUtxoResult$Sync"));
4974 CHECK(LDKUtxoResult_Sync_class != NULL);
4975 LDKUtxoResult_Sync_meth = (*env)->GetMethodID(env, LDKUtxoResult_Sync_class, "<init>", "(J)V");
4976 CHECK(LDKUtxoResult_Sync_meth != NULL);
4977 LDKUtxoResult_Async_class =
4978 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKUtxoResult$Async"));
4979 CHECK(LDKUtxoResult_Async_class != NULL);
4980 LDKUtxoResult_Async_meth = (*env)->GetMethodID(env, LDKUtxoResult_Async_class, "<init>", "(J)V");
4981 CHECK(LDKUtxoResult_Async_meth != NULL);
4983 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKUtxoResult_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
4984 LDKUtxoResult *obj = (LDKUtxoResult*)untag_ptr(ptr);
4986 case LDKUtxoResult_Sync: {
4987 LDKCResult_TxOutUtxoLookupErrorZ* sync_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ");
4988 *sync_conv = obj->sync;
4989 *sync_conv = CResult_TxOutUtxoLookupErrorZ_clone(sync_conv);
4990 return (*env)->NewObject(env, LDKUtxoResult_Sync_class, LDKUtxoResult_Sync_meth, tag_ptr(sync_conv, true));
4992 case LDKUtxoResult_Async: {
4993 LDKUtxoFuture async_var = obj->async;
4994 int64_t async_ref = 0;
4995 CHECK_INNER_FIELD_ACCESS_OR_NULL(async_var);
4996 async_ref = tag_ptr(async_var.inner, false);
4997 return (*env)->NewObject(env, LDKUtxoResult_Async_class, LDKUtxoResult_Async_meth, async_ref);
5002 typedef struct LDKUtxoLookup_JCalls {
5003 atomic_size_t refcnt;
5006 jmethodID get_utxo_meth;
5007 } LDKUtxoLookup_JCalls;
5008 static void LDKUtxoLookup_JCalls_free(void* this_arg) {
5009 LDKUtxoLookup_JCalls *j_calls = (LDKUtxoLookup_JCalls*) this_arg;
5010 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5012 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5013 if (get_jenv_res == JNI_EDETACHED) {
5014 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5016 DO_ASSERT(get_jenv_res == JNI_OK);
5018 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
5019 if (get_jenv_res == JNI_EDETACHED) {
5020 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5025 LDKUtxoResult get_utxo_LDKUtxoLookup_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) {
5026 LDKUtxoLookup_JCalls *j_calls = (LDKUtxoLookup_JCalls*) this_arg;
5028 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5029 if (get_jenv_res == JNI_EDETACHED) {
5030 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5032 DO_ASSERT(get_jenv_res == JNI_OK);
5034 int8_tArray genesis_hash_arr = (*env)->NewByteArray(env, 32);
5035 (*env)->SetByteArrayRegion(env, genesis_hash_arr, 0, 32, *genesis_hash);
5036 int64_t short_channel_id_conv = short_channel_id;
5037 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5039 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id_conv);
5040 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5041 (*env)->ExceptionDescribe(env);
5042 (*env)->FatalError(env, "A call to get_utxo in LDKUtxoLookup from rust threw an exception.");
5044 void* ret_ptr = untag_ptr(ret);
5045 CHECK_ACCESS(ret_ptr);
5046 LDKUtxoResult ret_conv = *(LDKUtxoResult*)(ret_ptr);
5047 FREE(untag_ptr(ret));
5048 if (get_jenv_res == JNI_EDETACHED) {
5049 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5053 static void LDKUtxoLookup_JCalls_cloned(LDKUtxoLookup* new_obj) {
5054 LDKUtxoLookup_JCalls *j_calls = (LDKUtxoLookup_JCalls*) new_obj->this_arg;
5055 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5057 static inline LDKUtxoLookup LDKUtxoLookup_init (JNIEnv *env, jclass clz, jobject o) {
5058 jclass c = (*env)->GetObjectClass(env, o);
5060 LDKUtxoLookup_JCalls *calls = MALLOC(sizeof(LDKUtxoLookup_JCalls), "LDKUtxoLookup_JCalls");
5061 atomic_init(&calls->refcnt, 1);
5062 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
5063 calls->o = (*env)->NewWeakGlobalRef(env, o);
5064 calls->get_utxo_meth = (*env)->GetMethodID(env, c, "get_utxo", "([BJ)J");
5065 CHECK(calls->get_utxo_meth != NULL);
5067 LDKUtxoLookup ret = {
5068 .this_arg = (void*) calls,
5069 .get_utxo = get_utxo_LDKUtxoLookup_jcall,
5070 .free = LDKUtxoLookup_JCalls_free,
5074 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKUtxoLookup_1new(JNIEnv *env, jclass clz, jobject o) {
5075 LDKUtxoLookup *res_ptr = MALLOC(sizeof(LDKUtxoLookup), "LDKUtxoLookup");
5076 *res_ptr = LDKUtxoLookup_init(env, clz, o);
5077 return tag_ptr(res_ptr, true);
5079 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) {
5080 void* this_arg_ptr = untag_ptr(this_arg);
5081 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5082 LDKUtxoLookup* this_arg_conv = (LDKUtxoLookup*)this_arg_ptr;
5083 uint8_t genesis_hash_arr[32];
5084 CHECK((*env)->GetArrayLength(env, genesis_hash) == 32);
5085 (*env)->GetByteArrayRegion(env, genesis_hash, 0, 32, genesis_hash_arr);
5086 uint8_t (*genesis_hash_ref)[32] = &genesis_hash_arr;
5087 LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult");
5088 *ret_copy = (this_arg_conv->get_utxo)(this_arg_conv->this_arg, genesis_hash_ref, short_channel_id);
5089 int64_t ret_ref = tag_ptr(ret_copy, true);
5093 static jclass LDKCOption_UtxoLookupZ_Some_class = NULL;
5094 static jmethodID LDKCOption_UtxoLookupZ_Some_meth = NULL;
5095 static jclass LDKCOption_UtxoLookupZ_None_class = NULL;
5096 static jmethodID LDKCOption_UtxoLookupZ_None_meth = NULL;
5097 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1UtxoLookupZ_init (JNIEnv *env, jclass clz) {
5098 LDKCOption_UtxoLookupZ_Some_class =
5099 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_UtxoLookupZ$Some"));
5100 CHECK(LDKCOption_UtxoLookupZ_Some_class != NULL);
5101 LDKCOption_UtxoLookupZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_UtxoLookupZ_Some_class, "<init>", "(J)V");
5102 CHECK(LDKCOption_UtxoLookupZ_Some_meth != NULL);
5103 LDKCOption_UtxoLookupZ_None_class =
5104 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_UtxoLookupZ$None"));
5105 CHECK(LDKCOption_UtxoLookupZ_None_class != NULL);
5106 LDKCOption_UtxoLookupZ_None_meth = (*env)->GetMethodID(env, LDKCOption_UtxoLookupZ_None_class, "<init>", "()V");
5107 CHECK(LDKCOption_UtxoLookupZ_None_meth != NULL);
5109 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1UtxoLookupZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
5110 LDKCOption_UtxoLookupZ *obj = (LDKCOption_UtxoLookupZ*)untag_ptr(ptr);
5112 case LDKCOption_UtxoLookupZ_Some: {
5113 LDKUtxoLookup* some_ret = MALLOC(sizeof(LDKUtxoLookup), "LDKUtxoLookup");
5114 *some_ret = obj->some;
5115 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
5116 if ((*some_ret).free == LDKUtxoLookup_JCalls_free) {
5117 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5118 LDKUtxoLookup_JCalls_cloned(&(*some_ret));
5120 return (*env)->NewObject(env, LDKCOption_UtxoLookupZ_Some_class, LDKCOption_UtxoLookupZ_Some_meth, tag_ptr(some_ret, true));
5122 case LDKCOption_UtxoLookupZ_None: {
5123 return (*env)->NewObject(env, LDKCOption_UtxoLookupZ_None_class, LDKCOption_UtxoLookupZ_None_meth);
5128 static inline bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){
5129 CHECK(owner->result_ok);
5130 return *owner->contents.result;
5132 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5133 LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner);
5134 jboolean ret_conv = CResult_boolLightningErrorZ_get_ok(owner_conv);
5138 static inline struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){
5139 LDKLightningError ret = *owner->contents.err;
5140 ret.is_owned = false;
5143 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5144 LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner);
5145 LDKLightningError ret_var = CResult_boolLightningErrorZ_get_err(owner_conv);
5146 int64_t ret_ref = 0;
5147 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5148 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5152 static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
5153 LDKChannelAnnouncement ret = owner->a;
5154 ret.is_owned = false;
5157 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
5158 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
5159 LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(owner_conv);
5160 int64_t ret_ref = 0;
5161 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5162 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5166 static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
5167 LDKChannelUpdate ret = owner->b;
5168 ret.is_owned = false;
5171 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
5172 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
5173 LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(owner_conv);
5174 int64_t ret_ref = 0;
5175 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5176 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5180 static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
5181 LDKChannelUpdate ret = owner->c;
5182 ret.is_owned = false;
5185 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) {
5186 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
5187 LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(owner_conv);
5188 int64_t ret_ref = 0;
5189 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5190 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5194 static jclass LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_class = NULL;
5195 static jmethodID LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_meth = NULL;
5196 static jclass LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_class = NULL;
5197 static jmethodID LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_meth = NULL;
5198 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_init (JNIEnv *env, jclass clz) {
5199 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_class =
5200 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ$Some"));
5201 CHECK(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_class != NULL);
5202 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_class, "<init>", "(J)V");
5203 CHECK(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_meth != NULL);
5204 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_class =
5205 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ$None"));
5206 CHECK(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_class != NULL);
5207 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_class, "<init>", "()V");
5208 CHECK(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_meth != NULL);
5210 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
5211 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *obj = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(ptr);
5213 case LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some: {
5214 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* some_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
5215 *some_conv = obj->some;
5216 *some_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(some_conv);
5217 return (*env)->NewObject(env, LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_class, LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some_meth, tag_ptr(some_conv, true));
5219 case LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None: {
5220 return (*env)->NewObject(env, LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_class, LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None_meth);
5225 static inline void CResult_NoneLightningErrorZ_get_ok(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){
5226 CHECK(owner->result_ok);
5227 return *owner->contents.result;
5229 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5230 LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(owner);
5231 CResult_NoneLightningErrorZ_get_ok(owner_conv);
5234 static inline struct LDKLightningError CResult_NoneLightningErrorZ_get_err(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){
5235 LDKLightningError ret = *owner->contents.err;
5236 ret.is_owned = false;
5239 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5240 LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(owner);
5241 LDKLightningError ret_var = CResult_NoneLightningErrorZ_get_err(owner_conv);
5242 int64_t ret_ref = 0;
5243 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5244 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5248 static inline struct LDKChannelUpdateInfo CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
5249 LDKChannelUpdateInfo ret = *owner->contents.result;
5250 ret.is_owned = false;
5253 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5254 LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
5255 LDKChannelUpdateInfo ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(owner_conv);
5256 int64_t ret_ref = 0;
5257 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5258 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5262 static inline struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
5263 CHECK(!owner->result_ok);
5264 return DecodeError_clone(&*owner->contents.err);
5266 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5267 LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
5268 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5269 *ret_copy = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv);
5270 int64_t ret_ref = tag_ptr(ret_copy, true);
5274 static inline struct LDKChannelInfo CResult_ChannelInfoDecodeErrorZ_get_ok(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
5275 LDKChannelInfo ret = *owner->contents.result;
5276 ret.is_owned = false;
5279 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5280 LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
5281 LDKChannelInfo ret_var = CResult_ChannelInfoDecodeErrorZ_get_ok(owner_conv);
5282 int64_t ret_ref = 0;
5283 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5284 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5288 static inline struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
5289 CHECK(!owner->result_ok);
5290 return DecodeError_clone(&*owner->contents.err);
5292 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5293 LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
5294 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5295 *ret_copy = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv);
5296 int64_t ret_ref = tag_ptr(ret_copy, true);
5300 static inline struct LDKRoutingFees CResult_RoutingFeesDecodeErrorZ_get_ok(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
5301 LDKRoutingFees ret = *owner->contents.result;
5302 ret.is_owned = false;
5305 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5306 LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
5307 LDKRoutingFees ret_var = CResult_RoutingFeesDecodeErrorZ_get_ok(owner_conv);
5308 int64_t ret_ref = 0;
5309 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5310 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5314 static inline struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
5315 CHECK(!owner->result_ok);
5316 return DecodeError_clone(&*owner->contents.err);
5318 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5319 LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
5320 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5321 *ret_copy = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv);
5322 int64_t ret_ref = tag_ptr(ret_copy, true);
5326 static jclass LDKNetAddress_IPv4_class = NULL;
5327 static jmethodID LDKNetAddress_IPv4_meth = NULL;
5328 static jclass LDKNetAddress_IPv6_class = NULL;
5329 static jmethodID LDKNetAddress_IPv6_meth = NULL;
5330 static jclass LDKNetAddress_OnionV2_class = NULL;
5331 static jmethodID LDKNetAddress_OnionV2_meth = NULL;
5332 static jclass LDKNetAddress_OnionV3_class = NULL;
5333 static jmethodID LDKNetAddress_OnionV3_meth = NULL;
5334 static jclass LDKNetAddress_Hostname_class = NULL;
5335 static jmethodID LDKNetAddress_Hostname_meth = NULL;
5336 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_init (JNIEnv *env, jclass clz) {
5337 LDKNetAddress_IPv4_class =
5338 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv4"));
5339 CHECK(LDKNetAddress_IPv4_class != NULL);
5340 LDKNetAddress_IPv4_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv4_class, "<init>", "([BS)V");
5341 CHECK(LDKNetAddress_IPv4_meth != NULL);
5342 LDKNetAddress_IPv6_class =
5343 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$IPv6"));
5344 CHECK(LDKNetAddress_IPv6_class != NULL);
5345 LDKNetAddress_IPv6_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv6_class, "<init>", "([BS)V");
5346 CHECK(LDKNetAddress_IPv6_meth != NULL);
5347 LDKNetAddress_OnionV2_class =
5348 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV2"));
5349 CHECK(LDKNetAddress_OnionV2_class != NULL);
5350 LDKNetAddress_OnionV2_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV2_class, "<init>", "([B)V");
5351 CHECK(LDKNetAddress_OnionV2_meth != NULL);
5352 LDKNetAddress_OnionV3_class =
5353 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$OnionV3"));
5354 CHECK(LDKNetAddress_OnionV3_class != NULL);
5355 LDKNetAddress_OnionV3_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV3_class, "<init>", "([BSBS)V");
5356 CHECK(LDKNetAddress_OnionV3_meth != NULL);
5357 LDKNetAddress_Hostname_class =
5358 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKNetAddress$Hostname"));
5359 CHECK(LDKNetAddress_Hostname_class != NULL);
5360 LDKNetAddress_Hostname_meth = (*env)->GetMethodID(env, LDKNetAddress_Hostname_class, "<init>", "(JS)V");
5361 CHECK(LDKNetAddress_Hostname_meth != NULL);
5363 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
5364 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
5366 case LDKNetAddress_IPv4: {
5367 int8_tArray addr_arr = (*env)->NewByteArray(env, 4);
5368 (*env)->SetByteArrayRegion(env, addr_arr, 0, 4, obj->i_pv4.addr.data);
5369 int16_t port_conv = obj->i_pv4.port;
5370 return (*env)->NewObject(env, LDKNetAddress_IPv4_class, LDKNetAddress_IPv4_meth, addr_arr, port_conv);
5372 case LDKNetAddress_IPv6: {
5373 int8_tArray addr_arr = (*env)->NewByteArray(env, 16);
5374 (*env)->SetByteArrayRegion(env, addr_arr, 0, 16, obj->i_pv6.addr.data);
5375 int16_t port_conv = obj->i_pv6.port;
5376 return (*env)->NewObject(env, LDKNetAddress_IPv6_class, LDKNetAddress_IPv6_meth, addr_arr, port_conv);
5378 case LDKNetAddress_OnionV2: {
5379 int8_tArray onion_v2_arr = (*env)->NewByteArray(env, 12);
5380 (*env)->SetByteArrayRegion(env, onion_v2_arr, 0, 12, obj->onion_v2.data);
5381 return (*env)->NewObject(env, LDKNetAddress_OnionV2_class, LDKNetAddress_OnionV2_meth, onion_v2_arr);
5383 case LDKNetAddress_OnionV3: {
5384 int8_tArray ed25519_pubkey_arr = (*env)->NewByteArray(env, 32);
5385 (*env)->SetByteArrayRegion(env, ed25519_pubkey_arr, 0, 32, obj->onion_v3.ed25519_pubkey.data);
5386 int16_t checksum_conv = obj->onion_v3.checksum;
5387 int8_t version_conv = obj->onion_v3.version;
5388 int16_t port_conv = obj->onion_v3.port;
5389 return (*env)->NewObject(env, LDKNetAddress_OnionV3_class, LDKNetAddress_OnionV3_meth, ed25519_pubkey_arr, checksum_conv, version_conv, port_conv);
5391 case LDKNetAddress_Hostname: {
5392 LDKHostname hostname_var = obj->hostname.hostname;
5393 int64_t hostname_ref = 0;
5394 CHECK_INNER_FIELD_ACCESS_OR_NULL(hostname_var);
5395 hostname_ref = tag_ptr(hostname_var.inner, false);
5396 int16_t port_conv = obj->hostname.port;
5397 return (*env)->NewObject(env, LDKNetAddress_Hostname_class, LDKNetAddress_Hostname_meth, hostname_ref, port_conv);
5402 static inline LDKCVec_NetAddressZ CVec_NetAddressZ_clone(const LDKCVec_NetAddressZ *orig) {
5403 LDKCVec_NetAddressZ ret = { .data = MALLOC(sizeof(LDKNetAddress) * orig->datalen, "LDKCVec_NetAddressZ clone bytes"), .datalen = orig->datalen };
5404 for (size_t i = 0; i < ret.datalen; i++) {
5405 ret.data[i] = NetAddress_clone(&orig->data[i]);
5409 static inline struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
5410 LDKNodeAnnouncementInfo ret = *owner->contents.result;
5411 ret.is_owned = false;
5414 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5415 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
5416 LDKNodeAnnouncementInfo ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv);
5417 int64_t ret_ref = 0;
5418 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5419 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5423 static inline struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
5424 CHECK(!owner->result_ok);
5425 return DecodeError_clone(&*owner->contents.err);
5427 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5428 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
5429 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5430 *ret_copy = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv);
5431 int64_t ret_ref = tag_ptr(ret_copy, true);
5435 static inline struct LDKNodeAlias CResult_NodeAliasDecodeErrorZ_get_ok(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
5436 LDKNodeAlias ret = *owner->contents.result;
5437 ret.is_owned = false;
5440 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5441 LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
5442 LDKNodeAlias ret_var = CResult_NodeAliasDecodeErrorZ_get_ok(owner_conv);
5443 int64_t ret_ref = 0;
5444 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5445 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5449 static inline struct LDKDecodeError CResult_NodeAliasDecodeErrorZ_get_err(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
5450 CHECK(!owner->result_ok);
5451 return DecodeError_clone(&*owner->contents.err);
5453 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5454 LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
5455 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5456 *ret_copy = CResult_NodeAliasDecodeErrorZ_get_err(owner_conv);
5457 int64_t ret_ref = tag_ptr(ret_copy, true);
5461 static inline struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
5462 LDKNodeInfo ret = *owner->contents.result;
5463 ret.is_owned = false;
5466 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5467 LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
5468 LDKNodeInfo ret_var = CResult_NodeInfoDecodeErrorZ_get_ok(owner_conv);
5469 int64_t ret_ref = 0;
5470 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5471 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5475 static inline struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
5476 CHECK(!owner->result_ok);
5477 return DecodeError_clone(&*owner->contents.err);
5479 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5480 LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
5481 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5482 *ret_copy = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv);
5483 int64_t ret_ref = tag_ptr(ret_copy, true);
5487 static inline struct LDKNetworkGraph CResult_NetworkGraphDecodeErrorZ_get_ok(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
5488 LDKNetworkGraph ret = *owner->contents.result;
5489 ret.is_owned = false;
5492 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5493 LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
5494 LDKNetworkGraph ret_var = CResult_NetworkGraphDecodeErrorZ_get_ok(owner_conv);
5495 int64_t ret_ref = 0;
5496 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5497 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5501 static inline struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
5502 CHECK(!owner->result_ok);
5503 return DecodeError_clone(&*owner->contents.err);
5505 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5506 LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
5507 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5508 *ret_copy = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv);
5509 int64_t ret_ref = tag_ptr(ret_copy, true);
5513 static jclass LDKCOption_CVec_NetAddressZZ_Some_class = NULL;
5514 static jmethodID LDKCOption_CVec_NetAddressZZ_Some_meth = NULL;
5515 static jclass LDKCOption_CVec_NetAddressZZ_None_class = NULL;
5516 static jmethodID LDKCOption_CVec_NetAddressZZ_None_meth = NULL;
5517 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CVec_1NetAddressZZ_init (JNIEnv *env, jclass clz) {
5518 LDKCOption_CVec_NetAddressZZ_Some_class =
5519 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$Some"));
5520 CHECK(LDKCOption_CVec_NetAddressZZ_Some_class != NULL);
5521 LDKCOption_CVec_NetAddressZZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_Some_class, "<init>", "([J)V");
5522 CHECK(LDKCOption_CVec_NetAddressZZ_Some_meth != NULL);
5523 LDKCOption_CVec_NetAddressZZ_None_class =
5524 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CVec_NetAddressZZ$None"));
5525 CHECK(LDKCOption_CVec_NetAddressZZ_None_class != NULL);
5526 LDKCOption_CVec_NetAddressZZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CVec_NetAddressZZ_None_class, "<init>", "()V");
5527 CHECK(LDKCOption_CVec_NetAddressZZ_None_meth != NULL);
5529 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CVec_1NetAddressZZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
5530 LDKCOption_CVec_NetAddressZZ *obj = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(ptr);
5532 case LDKCOption_CVec_NetAddressZZ_Some: {
5533 LDKCVec_NetAddressZ some_var = obj->some;
5534 int64_tArray some_arr = NULL;
5535 some_arr = (*env)->NewLongArray(env, some_var.datalen);
5536 int64_t *some_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, some_arr, NULL);
5537 for (size_t m = 0; m < some_var.datalen; m++) {
5538 int64_t some_conv_12_ref = tag_ptr(&some_var.data[m], false);
5539 some_arr_ptr[m] = some_conv_12_ref;
5541 (*env)->ReleasePrimitiveArrayCritical(env, some_arr, some_arr_ptr, 0);
5542 return (*env)->NewObject(env, LDKCOption_CVec_NetAddressZZ_Some_class, LDKCOption_CVec_NetAddressZZ_Some_meth, some_arr);
5544 case LDKCOption_CVec_NetAddressZZ_None: {
5545 return (*env)->NewObject(env, LDKCOption_CVec_NetAddressZZ_None_class, LDKCOption_CVec_NetAddressZZ_None_meth);
5550 static inline struct LDKDelayedPaymentOutputDescriptor CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
5551 LDKDelayedPaymentOutputDescriptor ret = *owner->contents.result;
5552 ret.is_owned = false;
5555 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5556 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
5557 LDKDelayedPaymentOutputDescriptor ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
5558 int64_t ret_ref = 0;
5559 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5560 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5564 static inline struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
5565 CHECK(!owner->result_ok);
5566 return DecodeError_clone(&*owner->contents.err);
5568 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5569 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
5570 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5571 *ret_copy = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
5572 int64_t ret_ref = tag_ptr(ret_copy, true);
5576 static inline struct LDKStaticPaymentOutputDescriptor CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
5577 LDKStaticPaymentOutputDescriptor ret = *owner->contents.result;
5578 ret.is_owned = false;
5581 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5582 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
5583 LDKStaticPaymentOutputDescriptor ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
5584 int64_t ret_ref = 0;
5585 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5586 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5590 static inline struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
5591 CHECK(!owner->result_ok);
5592 return DecodeError_clone(&*owner->contents.err);
5594 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5595 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
5596 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5597 *ret_copy = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
5598 int64_t ret_ref = tag_ptr(ret_copy, true);
5602 static inline struct LDKSpendableOutputDescriptor CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
5603 CHECK(owner->result_ok);
5604 return SpendableOutputDescriptor_clone(&*owner->contents.result);
5606 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5607 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
5608 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
5609 *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
5610 int64_t ret_ref = tag_ptr(ret_copy, true);
5614 static inline struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
5615 CHECK(!owner->result_ok);
5616 return DecodeError_clone(&*owner->contents.err);
5618 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5619 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
5620 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
5621 *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv);
5622 int64_t ret_ref = tag_ptr(ret_copy, true);
5626 static inline LDKCVec_PaymentPreimageZ CVec_PaymentPreimageZ_clone(const LDKCVec_PaymentPreimageZ *orig) {
5627 LDKCVec_PaymentPreimageZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_PaymentPreimageZ clone bytes"), .datalen = orig->datalen };
5628 for (size_t i = 0; i < ret.datalen; i++) {
5629 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
5633 static inline struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){
5636 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
5637 LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(owner);
5638 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
5639 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, C2Tuple_SignatureCVec_SignatureZZ_get_a(owner_conv).compact_form);
5643 static inline struct LDKCVec_SignatureZ C2Tuple_SignatureCVec_SignatureZZ_get_b(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){
5646 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
5647 LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(owner);
5648 LDKCVec_SignatureZ ret_var = C2Tuple_SignatureCVec_SignatureZZ_get_b(owner_conv);
5649 jobjectArray ret_arr = NULL;
5650 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
5652 for (size_t i = 0; i < ret_var.datalen; i++) {
5653 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64);
5654 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form);
5655 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
5661 static inline struct LDKC2Tuple_SignatureCVec_SignatureZZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){
5662 CHECK(owner->result_ok);
5663 return C2Tuple_SignatureCVec_SignatureZZ_clone(&*owner->contents.result);
5665 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5666 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(owner);
5667 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
5668 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(owner_conv);
5669 return tag_ptr(ret_conv, true);
5672 static inline void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){
5673 CHECK(!owner->result_ok);
5674 return *owner->contents.err;
5676 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5677 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(owner);
5678 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(owner_conv);
5681 static inline struct LDKSignature CResult_SignatureNoneZ_get_ok(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){
5682 CHECK(owner->result_ok);
5683 return *owner->contents.result;
5685 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5686 LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(owner);
5687 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
5688 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CResult_SignatureNoneZ_get_ok(owner_conv).compact_form);
5692 static inline void CResult_SignatureNoneZ_get_err(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){
5693 CHECK(!owner->result_ok);
5694 return *owner->contents.err;
5696 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5697 LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(owner);
5698 CResult_SignatureNoneZ_get_err(owner_conv);
5701 static inline struct LDKPublicKey CResult_PublicKeyNoneZ_get_ok(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){
5702 CHECK(owner->result_ok);
5703 return *owner->contents.result;
5705 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5706 LDKCResult_PublicKeyNoneZ* owner_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(owner);
5707 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
5708 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, CResult_PublicKeyNoneZ_get_ok(owner_conv).compressed_form);
5712 static inline void CResult_PublicKeyNoneZ_get_err(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){
5713 CHECK(!owner->result_ok);
5714 return *owner->contents.err;
5716 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5717 LDKCResult_PublicKeyNoneZ* owner_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(owner);
5718 CResult_PublicKeyNoneZ_get_err(owner_conv);
5721 static jclass LDKCOption_ScalarZ_Some_class = NULL;
5722 static jmethodID LDKCOption_ScalarZ_Some_meth = NULL;
5723 static jclass LDKCOption_ScalarZ_None_class = NULL;
5724 static jmethodID LDKCOption_ScalarZ_None_meth = NULL;
5725 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1ScalarZ_init (JNIEnv *env, jclass clz) {
5726 LDKCOption_ScalarZ_Some_class =
5727 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_ScalarZ$Some"));
5728 CHECK(LDKCOption_ScalarZ_Some_class != NULL);
5729 LDKCOption_ScalarZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_ScalarZ_Some_class, "<init>", "(J)V");
5730 CHECK(LDKCOption_ScalarZ_Some_meth != NULL);
5731 LDKCOption_ScalarZ_None_class =
5732 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_ScalarZ$None"));
5733 CHECK(LDKCOption_ScalarZ_None_class != NULL);
5734 LDKCOption_ScalarZ_None_meth = (*env)->GetMethodID(env, LDKCOption_ScalarZ_None_class, "<init>", "()V");
5735 CHECK(LDKCOption_ScalarZ_None_meth != NULL);
5737 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1ScalarZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
5738 LDKCOption_ScalarZ *obj = (LDKCOption_ScalarZ*)untag_ptr(ptr);
5740 case LDKCOption_ScalarZ_Some: {
5741 LDKBigEndianScalar* some_ref = &obj->some;
5742 return (*env)->NewObject(env, LDKCOption_ScalarZ_Some_class, LDKCOption_ScalarZ_Some_meth, tag_ptr(some_ref, false));
5744 case LDKCOption_ScalarZ_None: {
5745 return (*env)->NewObject(env, LDKCOption_ScalarZ_None_class, LDKCOption_ScalarZ_None_meth);
5750 static inline struct LDKThirtyTwoBytes CResult_SharedSecretNoneZ_get_ok(LDKCResult_SharedSecretNoneZ *NONNULL_PTR owner){
5751 CHECK(owner->result_ok);
5752 return ThirtyTwoBytes_clone(&*owner->contents.result);
5754 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5755 LDKCResult_SharedSecretNoneZ* owner_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(owner);
5756 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
5757 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_SharedSecretNoneZ_get_ok(owner_conv).data);
5761 static inline void CResult_SharedSecretNoneZ_get_err(LDKCResult_SharedSecretNoneZ *NONNULL_PTR owner){
5762 CHECK(!owner->result_ok);
5763 return *owner->contents.err;
5765 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5766 LDKCResult_SharedSecretNoneZ* owner_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(owner);
5767 CResult_SharedSecretNoneZ_get_err(owner_conv);
5770 static inline struct LDKRecoverableSignature CResult_RecoverableSignatureNoneZ_get_ok(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
5771 CHECK(owner->result_ok);
5772 return *owner->contents.result;
5774 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
5775 LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
5776 int8_tArray ret_arr = (*env)->NewByteArray(env, 68);
5777 (*env)->SetByteArrayRegion(env, ret_arr, 0, 68, CResult_RecoverableSignatureNoneZ_get_ok(owner_conv).serialized_form);
5781 static inline void CResult_RecoverableSignatureNoneZ_get_err(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
5782 CHECK(!owner->result_ok);
5783 return *owner->contents.err;
5785 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
5786 LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
5787 CResult_RecoverableSignatureNoneZ_get_err(owner_conv);
5790 typedef struct LDKChannelSigner_JCalls {
5791 atomic_size_t refcnt;
5794 jmethodID get_per_commitment_point_meth;
5795 jmethodID release_commitment_secret_meth;
5796 jmethodID validate_holder_commitment_meth;
5797 jmethodID channel_keys_id_meth;
5798 jmethodID provide_channel_parameters_meth;
5799 } LDKChannelSigner_JCalls;
5800 static void LDKChannelSigner_JCalls_free(void* this_arg) {
5801 LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg;
5802 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5804 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5805 if (get_jenv_res == JNI_EDETACHED) {
5806 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5808 DO_ASSERT(get_jenv_res == JNI_OK);
5810 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
5811 if (get_jenv_res == JNI_EDETACHED) {
5812 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5817 LDKPublicKey get_per_commitment_point_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) {
5818 LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg;
5820 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5821 if (get_jenv_res == JNI_EDETACHED) {
5822 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5824 DO_ASSERT(get_jenv_res == JNI_OK);
5826 int64_t idx_conv = idx;
5827 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5829 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_per_commitment_point_meth, idx_conv);
5830 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5831 (*env)->ExceptionDescribe(env);
5832 (*env)->FatalError(env, "A call to get_per_commitment_point in LDKChannelSigner from rust threw an exception.");
5834 LDKPublicKey ret_ref;
5835 CHECK((*env)->GetArrayLength(env, ret) == 33);
5836 (*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form);
5837 if (get_jenv_res == JNI_EDETACHED) {
5838 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5842 LDKThirtyTwoBytes release_commitment_secret_LDKChannelSigner_jcall(const void* this_arg, uint64_t idx) {
5843 LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg;
5845 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5846 if (get_jenv_res == JNI_EDETACHED) {
5847 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5849 DO_ASSERT(get_jenv_res == JNI_OK);
5851 int64_t idx_conv = idx;
5852 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5854 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_commitment_secret_meth, idx_conv);
5855 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5856 (*env)->ExceptionDescribe(env);
5857 (*env)->FatalError(env, "A call to release_commitment_secret in LDKChannelSigner from rust threw an exception.");
5859 LDKThirtyTwoBytes ret_ref;
5860 CHECK((*env)->GetArrayLength(env, ret) == 32);
5861 (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
5862 if (get_jenv_res == JNI_EDETACHED) {
5863 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5867 LDKCResult_NoneNoneZ validate_holder_commitment_LDKChannelSigner_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_PaymentPreimageZ preimages) {
5868 LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg;
5870 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5871 if (get_jenv_res == JNI_EDETACHED) {
5872 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5874 DO_ASSERT(get_jenv_res == JNI_OK);
5876 LDKHolderCommitmentTransaction holder_tx_var = *holder_tx;
5877 int64_t holder_tx_ref = 0;
5878 holder_tx_var = HolderCommitmentTransaction_clone(&holder_tx_var);
5879 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var);
5880 holder_tx_ref = tag_ptr(holder_tx_var.inner, holder_tx_var.is_owned);
5881 LDKCVec_PaymentPreimageZ preimages_var = preimages;
5882 jobjectArray preimages_arr = NULL;
5883 preimages_arr = (*env)->NewObjectArray(env, preimages_var.datalen, arr_of_B_clz, NULL);
5885 for (size_t i = 0; i < preimages_var.datalen; i++) {
5886 int8_tArray preimages_conv_8_arr = (*env)->NewByteArray(env, 32);
5887 (*env)->SetByteArrayRegion(env, preimages_conv_8_arr, 0, 32, preimages_var.data[i].data);
5888 (*env)->SetObjectArrayElement(env, preimages_arr, i, preimages_conv_8_arr);
5891 FREE(preimages_var.data);
5892 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5894 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->validate_holder_commitment_meth, holder_tx_ref, preimages_arr);
5895 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5896 (*env)->ExceptionDescribe(env);
5897 (*env)->FatalError(env, "A call to validate_holder_commitment in LDKChannelSigner from rust threw an exception.");
5899 void* ret_ptr = untag_ptr(ret);
5900 CHECK_ACCESS(ret_ptr);
5901 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
5902 FREE(untag_ptr(ret));
5903 if (get_jenv_res == JNI_EDETACHED) {
5904 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5908 LDKThirtyTwoBytes channel_keys_id_LDKChannelSigner_jcall(const void* this_arg) {
5909 LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg;
5911 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5912 if (get_jenv_res == JNI_EDETACHED) {
5913 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5915 DO_ASSERT(get_jenv_res == JNI_OK);
5917 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5919 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->channel_keys_id_meth);
5920 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5921 (*env)->ExceptionDescribe(env);
5922 (*env)->FatalError(env, "A call to channel_keys_id in LDKChannelSigner from rust threw an exception.");
5924 LDKThirtyTwoBytes ret_ref;
5925 CHECK((*env)->GetArrayLength(env, ret) == 32);
5926 (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
5927 if (get_jenv_res == JNI_EDETACHED) {
5928 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5932 void provide_channel_parameters_LDKChannelSigner_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
5933 LDKChannelSigner_JCalls *j_calls = (LDKChannelSigner_JCalls*) this_arg;
5935 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
5936 if (get_jenv_res == JNI_EDETACHED) {
5937 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
5939 DO_ASSERT(get_jenv_res == JNI_OK);
5941 LDKChannelTransactionParameters channel_parameters_var = *channel_parameters;
5942 int64_t channel_parameters_ref = 0;
5943 channel_parameters_var = ChannelTransactionParameters_clone(&channel_parameters_var);
5944 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var);
5945 channel_parameters_ref = tag_ptr(channel_parameters_var.inner, channel_parameters_var.is_owned);
5946 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
5948 (*env)->CallVoidMethod(env, obj, j_calls->provide_channel_parameters_meth, channel_parameters_ref);
5949 if (UNLIKELY((*env)->ExceptionCheck(env))) {
5950 (*env)->ExceptionDescribe(env);
5951 (*env)->FatalError(env, "A call to provide_channel_parameters in LDKChannelSigner from rust threw an exception.");
5953 if (get_jenv_res == JNI_EDETACHED) {
5954 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
5957 static inline LDKChannelSigner LDKChannelSigner_init (JNIEnv *env, jclass clz, jobject o, int64_t pubkeys) {
5958 jclass c = (*env)->GetObjectClass(env, o);
5960 LDKChannelSigner_JCalls *calls = MALLOC(sizeof(LDKChannelSigner_JCalls), "LDKChannelSigner_JCalls");
5961 atomic_init(&calls->refcnt, 1);
5962 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
5963 calls->o = (*env)->NewWeakGlobalRef(env, o);
5964 calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "(J)[B");
5965 CHECK(calls->get_per_commitment_point_meth != NULL);
5966 calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)[B");
5967 CHECK(calls->release_commitment_secret_meth != NULL);
5968 calls->validate_holder_commitment_meth = (*env)->GetMethodID(env, c, "validate_holder_commitment", "(J[[B)J");
5969 CHECK(calls->validate_holder_commitment_meth != NULL);
5970 calls->channel_keys_id_meth = (*env)->GetMethodID(env, c, "channel_keys_id", "()[B");
5971 CHECK(calls->channel_keys_id_meth != NULL);
5972 calls->provide_channel_parameters_meth = (*env)->GetMethodID(env, c, "provide_channel_parameters", "(J)V");
5973 CHECK(calls->provide_channel_parameters_meth != NULL);
5975 LDKChannelPublicKeys pubkeys_conv;
5976 pubkeys_conv.inner = untag_ptr(pubkeys);
5977 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
5978 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
5980 LDKChannelSigner ret = {
5981 .this_arg = (void*) calls,
5982 .get_per_commitment_point = get_per_commitment_point_LDKChannelSigner_jcall,
5983 .release_commitment_secret = release_commitment_secret_LDKChannelSigner_jcall,
5984 .validate_holder_commitment = validate_holder_commitment_LDKChannelSigner_jcall,
5985 .channel_keys_id = channel_keys_id_LDKChannelSigner_jcall,
5986 .provide_channel_parameters = provide_channel_parameters_LDKChannelSigner_jcall,
5987 .free = LDKChannelSigner_JCalls_free,
5988 .pubkeys = pubkeys_conv,
5989 .set_pubkeys = NULL,
5993 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKChannelSigner_1new(JNIEnv *env, jclass clz, jobject o, int64_t pubkeys) {
5994 LDKChannelSigner *res_ptr = MALLOC(sizeof(LDKChannelSigner), "LDKChannelSigner");
5995 *res_ptr = LDKChannelSigner_init(env, clz, o, pubkeys);
5996 return tag_ptr(res_ptr, true);
5998 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) {
5999 void* this_arg_ptr = untag_ptr(this_arg);
6000 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6001 LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr;
6002 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
6003 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form);
6007 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1release_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) {
6008 void* this_arg_ptr = untag_ptr(this_arg);
6009 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6010 LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr;
6011 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6012 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data);
6016 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) {
6017 void* this_arg_ptr = untag_ptr(this_arg);
6018 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6019 LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr;
6020 LDKHolderCommitmentTransaction holder_tx_conv;
6021 holder_tx_conv.inner = untag_ptr(holder_tx);
6022 holder_tx_conv.is_owned = ptr_is_owned(holder_tx);
6023 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv);
6024 holder_tx_conv.is_owned = false;
6025 LDKCVec_PaymentPreimageZ preimages_constr;
6026 preimages_constr.datalen = (*env)->GetArrayLength(env, preimages);
6027 if (preimages_constr.datalen > 0)
6028 preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
6030 preimages_constr.data = NULL;
6031 for (size_t i = 0; i < preimages_constr.datalen; i++) {
6032 int8_tArray preimages_conv_8 = (*env)->GetObjectArrayElement(env, preimages, i);
6033 LDKThirtyTwoBytes preimages_conv_8_ref;
6034 CHECK((*env)->GetArrayLength(env, preimages_conv_8) == 32);
6035 (*env)->GetByteArrayRegion(env, preimages_conv_8, 0, 32, preimages_conv_8_ref.data);
6036 preimages_constr.data[i] = preimages_conv_8_ref;
6038 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
6039 *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv, preimages_constr);
6040 return tag_ptr(ret_conv, true);
6043 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
6044 void* this_arg_ptr = untag_ptr(this_arg);
6045 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6046 LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr;
6047 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6048 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data);
6052 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1provide_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_parameters) {
6053 void* this_arg_ptr = untag_ptr(this_arg);
6054 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6055 LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr;
6056 LDKChannelTransactionParameters channel_parameters_conv;
6057 channel_parameters_conv.inner = untag_ptr(channel_parameters);
6058 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
6059 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
6060 channel_parameters_conv.is_owned = false;
6061 (this_arg_conv->provide_channel_parameters)(this_arg_conv->this_arg, &channel_parameters_conv);
6064 LDKChannelPublicKeys LDKChannelSigner_set_get_pubkeys(LDKChannelSigner* this_arg) {
6065 if (this_arg->set_pubkeys != NULL)
6066 this_arg->set_pubkeys(this_arg);
6067 return this_arg->pubkeys;
6069 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1get_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
6070 void* this_arg_ptr = untag_ptr(this_arg);
6071 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6072 LDKChannelSigner* this_arg_conv = (LDKChannelSigner*)this_arg_ptr;
6073 LDKChannelPublicKeys ret_var = LDKChannelSigner_set_get_pubkeys(this_arg_conv);
6074 int64_t ret_ref = 0;
6075 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6076 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6080 typedef struct LDKEcdsaChannelSigner_JCalls {
6081 atomic_size_t refcnt;
6084 LDKChannelSigner_JCalls* ChannelSigner;
6085 jmethodID sign_counterparty_commitment_meth;
6086 jmethodID validate_counterparty_revocation_meth;
6087 jmethodID sign_holder_commitment_and_htlcs_meth;
6088 jmethodID sign_justice_revoked_output_meth;
6089 jmethodID sign_justice_revoked_htlc_meth;
6090 jmethodID sign_counterparty_htlc_transaction_meth;
6091 jmethodID sign_closing_transaction_meth;
6092 jmethodID sign_holder_anchor_input_meth;
6093 jmethodID sign_channel_announcement_with_funding_key_meth;
6094 } LDKEcdsaChannelSigner_JCalls;
6095 static void LDKEcdsaChannelSigner_JCalls_free(void* this_arg) {
6096 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
6097 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
6099 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6100 if (get_jenv_res == JNI_EDETACHED) {
6101 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6103 DO_ASSERT(get_jenv_res == JNI_OK);
6105 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
6106 if (get_jenv_res == JNI_EDETACHED) {
6107 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6112 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_LDKEcdsaChannelSigner_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx, LDKCVec_PaymentPreimageZ preimages) {
6113 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
6115 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6116 if (get_jenv_res == JNI_EDETACHED) {
6117 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6119 DO_ASSERT(get_jenv_res == JNI_OK);
6121 LDKCommitmentTransaction commitment_tx_var = *commitment_tx;
6122 int64_t commitment_tx_ref = 0;
6123 commitment_tx_var = CommitmentTransaction_clone(&commitment_tx_var);
6124 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
6125 commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned);
6126 LDKCVec_PaymentPreimageZ preimages_var = preimages;
6127 jobjectArray preimages_arr = NULL;
6128 preimages_arr = (*env)->NewObjectArray(env, preimages_var.datalen, arr_of_B_clz, NULL);
6130 for (size_t i = 0; i < preimages_var.datalen; i++) {
6131 int8_tArray preimages_conv_8_arr = (*env)->NewByteArray(env, 32);
6132 (*env)->SetByteArrayRegion(env, preimages_conv_8_arr, 0, 32, preimages_var.data[i].data);
6133 (*env)->SetObjectArrayElement(env, preimages_arr, i, preimages_conv_8_arr);
6136 FREE(preimages_var.data);
6137 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6139 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_counterparty_commitment_meth, commitment_tx_ref, preimages_arr);
6140 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6141 (*env)->ExceptionDescribe(env);
6142 (*env)->FatalError(env, "A call to sign_counterparty_commitment in LDKEcdsaChannelSigner from rust threw an exception.");
6144 void* ret_ptr = untag_ptr(ret);
6145 CHECK_ACCESS(ret_ptr);
6146 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
6147 FREE(untag_ptr(ret));
6148 if (get_jenv_res == JNI_EDETACHED) {
6149 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6153 LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKEcdsaChannelSigner_jcall(const void* this_arg, uint64_t idx, const uint8_t (* secret)[32]) {
6154 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
6156 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6157 if (get_jenv_res == JNI_EDETACHED) {
6158 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6160 DO_ASSERT(get_jenv_res == JNI_OK);
6162 int64_t idx_conv = idx;
6163 int8_tArray secret_arr = (*env)->NewByteArray(env, 32);
6164 (*env)->SetByteArrayRegion(env, secret_arr, 0, 32, *secret);
6165 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6167 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->validate_counterparty_revocation_meth, idx_conv, secret_arr);
6168 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6169 (*env)->ExceptionDescribe(env);
6170 (*env)->FatalError(env, "A call to validate_counterparty_revocation in LDKEcdsaChannelSigner from rust threw an exception.");
6172 void* ret_ptr = untag_ptr(ret);
6173 CHECK_ACCESS(ret_ptr);
6174 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
6175 FREE(untag_ptr(ret));
6176 if (get_jenv_res == JNI_EDETACHED) {
6177 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6181 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKEcdsaChannelSigner_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
6182 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
6184 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6185 if (get_jenv_res == JNI_EDETACHED) {
6186 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6188 DO_ASSERT(get_jenv_res == JNI_OK);
6190 LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx;
6191 int64_t commitment_tx_ref = 0;
6192 commitment_tx_var = HolderCommitmentTransaction_clone(&commitment_tx_var);
6193 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
6194 commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned);
6195 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6197 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_holder_commitment_and_htlcs_meth, commitment_tx_ref);
6198 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6199 (*env)->ExceptionDescribe(env);
6200 (*env)->FatalError(env, "A call to sign_holder_commitment_and_htlcs in LDKEcdsaChannelSigner from rust threw an exception.");
6202 void* ret_ptr = untag_ptr(ret);
6203 CHECK_ACCESS(ret_ptr);
6204 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
6205 FREE(untag_ptr(ret));
6206 if (get_jenv_res == JNI_EDETACHED) {
6207 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6211 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]) {
6212 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
6214 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6215 if (get_jenv_res == JNI_EDETACHED) {
6216 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6218 DO_ASSERT(get_jenv_res == JNI_OK);
6220 LDKTransaction justice_tx_var = justice_tx;
6221 int8_tArray justice_tx_arr = (*env)->NewByteArray(env, justice_tx_var.datalen);
6222 (*env)->SetByteArrayRegion(env, justice_tx_arr, 0, justice_tx_var.datalen, justice_tx_var.data);
6223 Transaction_free(justice_tx_var);
6224 int64_t input_conv = input;
6225 int64_t amount_conv = amount;
6226 int8_tArray per_commitment_key_arr = (*env)->NewByteArray(env, 32);
6227 (*env)->SetByteArrayRegion(env, per_commitment_key_arr, 0, 32, *per_commitment_key);
6228 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6230 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);
6231 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6232 (*env)->ExceptionDescribe(env);
6233 (*env)->FatalError(env, "A call to sign_justice_revoked_output 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 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) {
6245 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
6247 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6248 if (get_jenv_res == JNI_EDETACHED) {
6249 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6251 DO_ASSERT(get_jenv_res == JNI_OK);
6253 LDKTransaction justice_tx_var = justice_tx;
6254 int8_tArray justice_tx_arr = (*env)->NewByteArray(env, justice_tx_var.datalen);
6255 (*env)->SetByteArrayRegion(env, justice_tx_arr, 0, justice_tx_var.datalen, justice_tx_var.data);
6256 Transaction_free(justice_tx_var);
6257 int64_t input_conv = input;
6258 int64_t amount_conv = amount;
6259 int8_tArray per_commitment_key_arr = (*env)->NewByteArray(env, 32);
6260 (*env)->SetByteArrayRegion(env, per_commitment_key_arr, 0, 32, *per_commitment_key);
6261 LDKHTLCOutputInCommitment htlc_var = *htlc;
6262 int64_t htlc_ref = 0;
6263 htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
6264 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
6265 htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
6266 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6268 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);
6269 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6270 (*env)->ExceptionDescribe(env);
6271 (*env)->FatalError(env, "A call to sign_justice_revoked_htlc in LDKEcdsaChannelSigner from rust threw an exception.");
6273 void* ret_ptr = untag_ptr(ret);
6274 CHECK_ACCESS(ret_ptr);
6275 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
6276 FREE(untag_ptr(ret));
6277 if (get_jenv_res == JNI_EDETACHED) {
6278 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6282 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) {
6283 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
6285 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6286 if (get_jenv_res == JNI_EDETACHED) {
6287 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6289 DO_ASSERT(get_jenv_res == JNI_OK);
6291 LDKTransaction htlc_tx_var = htlc_tx;
6292 int8_tArray htlc_tx_arr = (*env)->NewByteArray(env, htlc_tx_var.datalen);
6293 (*env)->SetByteArrayRegion(env, htlc_tx_arr, 0, htlc_tx_var.datalen, htlc_tx_var.data);
6294 Transaction_free(htlc_tx_var);
6295 int64_t input_conv = input;
6296 int64_t amount_conv = amount;
6297 int8_tArray per_commitment_point_arr = (*env)->NewByteArray(env, 33);
6298 (*env)->SetByteArrayRegion(env, per_commitment_point_arr, 0, 33, per_commitment_point.compressed_form);
6299 LDKHTLCOutputInCommitment htlc_var = *htlc;
6300 int64_t htlc_ref = 0;
6301 htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
6302 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
6303 htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
6304 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6306 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);
6307 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6308 (*env)->ExceptionDescribe(env);
6309 (*env)->FatalError(env, "A call to sign_counterparty_htlc_transaction in LDKEcdsaChannelSigner from rust threw an exception.");
6311 void* ret_ptr = untag_ptr(ret);
6312 CHECK_ACCESS(ret_ptr);
6313 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
6314 FREE(untag_ptr(ret));
6315 if (get_jenv_res == JNI_EDETACHED) {
6316 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6320 LDKCResult_SignatureNoneZ sign_closing_transaction_LDKEcdsaChannelSigner_jcall(const void* this_arg, const LDKClosingTransaction * closing_tx) {
6321 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
6323 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6324 if (get_jenv_res == JNI_EDETACHED) {
6325 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6327 DO_ASSERT(get_jenv_res == JNI_OK);
6329 LDKClosingTransaction closing_tx_var = *closing_tx;
6330 int64_t closing_tx_ref = 0;
6331 closing_tx_var = ClosingTransaction_clone(&closing_tx_var);
6332 CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_var);
6333 closing_tx_ref = tag_ptr(closing_tx_var.inner, closing_tx_var.is_owned);
6334 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6336 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_closing_transaction_meth, closing_tx_ref);
6337 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6338 (*env)->ExceptionDescribe(env);
6339 (*env)->FatalError(env, "A call to sign_closing_transaction in LDKEcdsaChannelSigner from rust threw an exception.");
6341 void* ret_ptr = untag_ptr(ret);
6342 CHECK_ACCESS(ret_ptr);
6343 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
6344 FREE(untag_ptr(ret));
6345 if (get_jenv_res == JNI_EDETACHED) {
6346 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6350 LDKCResult_SignatureNoneZ sign_holder_anchor_input_LDKEcdsaChannelSigner_jcall(const void* this_arg, LDKTransaction anchor_tx, uintptr_t input) {
6351 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
6353 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6354 if (get_jenv_res == JNI_EDETACHED) {
6355 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6357 DO_ASSERT(get_jenv_res == JNI_OK);
6359 LDKTransaction anchor_tx_var = anchor_tx;
6360 int8_tArray anchor_tx_arr = (*env)->NewByteArray(env, anchor_tx_var.datalen);
6361 (*env)->SetByteArrayRegion(env, anchor_tx_arr, 0, anchor_tx_var.datalen, anchor_tx_var.data);
6362 Transaction_free(anchor_tx_var);
6363 int64_t input_conv = input;
6364 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6366 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_holder_anchor_input_meth, anchor_tx_arr, input_conv);
6367 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6368 (*env)->ExceptionDescribe(env);
6369 (*env)->FatalError(env, "A call to sign_holder_anchor_input in LDKEcdsaChannelSigner from rust threw an exception.");
6371 void* ret_ptr = untag_ptr(ret);
6372 CHECK_ACCESS(ret_ptr);
6373 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
6374 FREE(untag_ptr(ret));
6375 if (get_jenv_res == JNI_EDETACHED) {
6376 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6380 LDKCResult_SignatureNoneZ sign_channel_announcement_with_funding_key_LDKEcdsaChannelSigner_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
6381 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) this_arg;
6383 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6384 if (get_jenv_res == JNI_EDETACHED) {
6385 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6387 DO_ASSERT(get_jenv_res == JNI_OK);
6389 LDKUnsignedChannelAnnouncement msg_var = *msg;
6390 int64_t msg_ref = 0;
6391 msg_var = UnsignedChannelAnnouncement_clone(&msg_var);
6392 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
6393 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
6394 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6396 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_channel_announcement_with_funding_key_meth, msg_ref);
6397 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6398 (*env)->ExceptionDescribe(env);
6399 (*env)->FatalError(env, "A call to sign_channel_announcement_with_funding_key in LDKEcdsaChannelSigner from rust threw an exception.");
6401 void* ret_ptr = untag_ptr(ret);
6402 CHECK_ACCESS(ret_ptr);
6403 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
6404 FREE(untag_ptr(ret));
6405 if (get_jenv_res == JNI_EDETACHED) {
6406 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6410 static void LDKEcdsaChannelSigner_JCalls_cloned(LDKEcdsaChannelSigner* new_obj) {
6411 LDKEcdsaChannelSigner_JCalls *j_calls = (LDKEcdsaChannelSigner_JCalls*) new_obj->this_arg;
6412 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
6413 atomic_fetch_add_explicit(&j_calls->ChannelSigner->refcnt, 1, memory_order_release);
6415 static inline LDKEcdsaChannelSigner LDKEcdsaChannelSigner_init (JNIEnv *env, jclass clz, jobject o, jobject ChannelSigner, int64_t pubkeys) {
6416 jclass c = (*env)->GetObjectClass(env, o);
6418 LDKEcdsaChannelSigner_JCalls *calls = MALLOC(sizeof(LDKEcdsaChannelSigner_JCalls), "LDKEcdsaChannelSigner_JCalls");
6419 atomic_init(&calls->refcnt, 1);
6420 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
6421 calls->o = (*env)->NewWeakGlobalRef(env, o);
6422 calls->sign_counterparty_commitment_meth = (*env)->GetMethodID(env, c, "sign_counterparty_commitment", "(J[[B)J");
6423 CHECK(calls->sign_counterparty_commitment_meth != NULL);
6424 calls->validate_counterparty_revocation_meth = (*env)->GetMethodID(env, c, "validate_counterparty_revocation", "(J[B)J");
6425 CHECK(calls->validate_counterparty_revocation_meth != NULL);
6426 calls->sign_holder_commitment_and_htlcs_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment_and_htlcs", "(J)J");
6427 CHECK(calls->sign_holder_commitment_and_htlcs_meth != NULL);
6428 calls->sign_justice_revoked_output_meth = (*env)->GetMethodID(env, c, "sign_justice_revoked_output", "([BJJ[B)J");
6429 CHECK(calls->sign_justice_revoked_output_meth != NULL);
6430 calls->sign_justice_revoked_htlc_meth = (*env)->GetMethodID(env, c, "sign_justice_revoked_htlc", "([BJJ[BJ)J");
6431 CHECK(calls->sign_justice_revoked_htlc_meth != NULL);
6432 calls->sign_counterparty_htlc_transaction_meth = (*env)->GetMethodID(env, c, "sign_counterparty_htlc_transaction", "([BJJ[BJ)J");
6433 CHECK(calls->sign_counterparty_htlc_transaction_meth != NULL);
6434 calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "(J)J");
6435 CHECK(calls->sign_closing_transaction_meth != NULL);
6436 calls->sign_holder_anchor_input_meth = (*env)->GetMethodID(env, c, "sign_holder_anchor_input", "([BJ)J");
6437 CHECK(calls->sign_holder_anchor_input_meth != NULL);
6438 calls->sign_channel_announcement_with_funding_key_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement_with_funding_key", "(J)J");
6439 CHECK(calls->sign_channel_announcement_with_funding_key_meth != NULL);
6441 LDKChannelPublicKeys pubkeys_conv;
6442 pubkeys_conv.inner = untag_ptr(pubkeys);
6443 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
6444 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
6446 LDKEcdsaChannelSigner ret = {
6447 .this_arg = (void*) calls,
6448 .sign_counterparty_commitment = sign_counterparty_commitment_LDKEcdsaChannelSigner_jcall,
6449 .validate_counterparty_revocation = validate_counterparty_revocation_LDKEcdsaChannelSigner_jcall,
6450 .sign_holder_commitment_and_htlcs = sign_holder_commitment_and_htlcs_LDKEcdsaChannelSigner_jcall,
6451 .sign_justice_revoked_output = sign_justice_revoked_output_LDKEcdsaChannelSigner_jcall,
6452 .sign_justice_revoked_htlc = sign_justice_revoked_htlc_LDKEcdsaChannelSigner_jcall,
6453 .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_LDKEcdsaChannelSigner_jcall,
6454 .sign_closing_transaction = sign_closing_transaction_LDKEcdsaChannelSigner_jcall,
6455 .sign_holder_anchor_input = sign_holder_anchor_input_LDKEcdsaChannelSigner_jcall,
6456 .sign_channel_announcement_with_funding_key = sign_channel_announcement_with_funding_key_LDKEcdsaChannelSigner_jcall,
6457 .free = LDKEcdsaChannelSigner_JCalls_free,
6458 .ChannelSigner = LDKChannelSigner_init(env, clz, ChannelSigner, pubkeys),
6460 calls->ChannelSigner = ret.ChannelSigner.this_arg;
6463 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKEcdsaChannelSigner_1new(JNIEnv *env, jclass clz, jobject o, jobject ChannelSigner, int64_t pubkeys) {
6464 LDKEcdsaChannelSigner *res_ptr = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner");
6465 *res_ptr = LDKEcdsaChannelSigner_init(env, clz, o, ChannelSigner, pubkeys);
6466 return tag_ptr(res_ptr, true);
6468 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKEcdsaChannelSigner_1get_1ChannelSigner(JNIEnv *env, jclass clz, int64_t arg) {
6469 LDKEcdsaChannelSigner *inp = (LDKEcdsaChannelSigner *)untag_ptr(arg);
6470 return tag_ptr(&inp->ChannelSigner, false);
6472 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) {
6473 void* this_arg_ptr = untag_ptr(this_arg);
6474 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6475 LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
6476 LDKCommitmentTransaction commitment_tx_conv;
6477 commitment_tx_conv.inner = untag_ptr(commitment_tx);
6478 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
6479 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
6480 commitment_tx_conv.is_owned = false;
6481 LDKCVec_PaymentPreimageZ preimages_constr;
6482 preimages_constr.datalen = (*env)->GetArrayLength(env, preimages);
6483 if (preimages_constr.datalen > 0)
6484 preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
6486 preimages_constr.data = NULL;
6487 for (size_t i = 0; i < preimages_constr.datalen; i++) {
6488 int8_tArray preimages_conv_8 = (*env)->GetObjectArrayElement(env, preimages, i);
6489 LDKThirtyTwoBytes preimages_conv_8_ref;
6490 CHECK((*env)->GetArrayLength(env, preimages_conv_8) == 32);
6491 (*env)->GetByteArrayRegion(env, preimages_conv_8, 0, 32, preimages_conv_8_ref.data);
6492 preimages_constr.data[i] = preimages_conv_8_ref;
6494 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
6495 *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv, preimages_constr);
6496 return tag_ptr(ret_conv, true);
6499 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) {
6500 void* this_arg_ptr = untag_ptr(this_arg);
6501 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6502 LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
6503 uint8_t secret_arr[32];
6504 CHECK((*env)->GetArrayLength(env, secret) == 32);
6505 (*env)->GetByteArrayRegion(env, secret, 0, 32, secret_arr);
6506 uint8_t (*secret_ref)[32] = &secret_arr;
6507 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
6508 *ret_conv = (this_arg_conv->validate_counterparty_revocation)(this_arg_conv->this_arg, idx, secret_ref);
6509 return tag_ptr(ret_conv, true);
6512 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) {
6513 void* this_arg_ptr = untag_ptr(this_arg);
6514 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6515 LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
6516 LDKHolderCommitmentTransaction commitment_tx_conv;
6517 commitment_tx_conv.inner = untag_ptr(commitment_tx);
6518 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
6519 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
6520 commitment_tx_conv.is_owned = false;
6521 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
6522 *ret_conv = (this_arg_conv->sign_holder_commitment_and_htlcs)(this_arg_conv->this_arg, &commitment_tx_conv);
6523 return tag_ptr(ret_conv, true);
6526 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) {
6527 void* this_arg_ptr = untag_ptr(this_arg);
6528 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6529 LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
6530 LDKTransaction justice_tx_ref;
6531 justice_tx_ref.datalen = (*env)->GetArrayLength(env, justice_tx);
6532 justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
6533 (*env)->GetByteArrayRegion(env, justice_tx, 0, justice_tx_ref.datalen, justice_tx_ref.data);
6534 justice_tx_ref.data_is_owned = true;
6535 uint8_t per_commitment_key_arr[32];
6536 CHECK((*env)->GetArrayLength(env, per_commitment_key) == 32);
6537 (*env)->GetByteArrayRegion(env, per_commitment_key, 0, 32, per_commitment_key_arr);
6538 uint8_t (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
6539 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
6540 *ret_conv = (this_arg_conv->sign_justice_revoked_output)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref);
6541 return tag_ptr(ret_conv, true);
6544 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) {
6545 void* this_arg_ptr = untag_ptr(this_arg);
6546 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6547 LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
6548 LDKTransaction justice_tx_ref;
6549 justice_tx_ref.datalen = (*env)->GetArrayLength(env, justice_tx);
6550 justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
6551 (*env)->GetByteArrayRegion(env, justice_tx, 0, justice_tx_ref.datalen, justice_tx_ref.data);
6552 justice_tx_ref.data_is_owned = true;
6553 uint8_t per_commitment_key_arr[32];
6554 CHECK((*env)->GetArrayLength(env, per_commitment_key) == 32);
6555 (*env)->GetByteArrayRegion(env, per_commitment_key, 0, 32, per_commitment_key_arr);
6556 uint8_t (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
6557 LDKHTLCOutputInCommitment htlc_conv;
6558 htlc_conv.inner = untag_ptr(htlc);
6559 htlc_conv.is_owned = ptr_is_owned(htlc);
6560 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
6561 htlc_conv.is_owned = false;
6562 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
6563 *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);
6564 return tag_ptr(ret_conv, true);
6567 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) {
6568 void* this_arg_ptr = untag_ptr(this_arg);
6569 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6570 LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
6571 LDKTransaction htlc_tx_ref;
6572 htlc_tx_ref.datalen = (*env)->GetArrayLength(env, htlc_tx);
6573 htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes");
6574 (*env)->GetByteArrayRegion(env, htlc_tx, 0, htlc_tx_ref.datalen, htlc_tx_ref.data);
6575 htlc_tx_ref.data_is_owned = true;
6576 LDKPublicKey per_commitment_point_ref;
6577 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
6578 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
6579 LDKHTLCOutputInCommitment htlc_conv;
6580 htlc_conv.inner = untag_ptr(htlc);
6581 htlc_conv.is_owned = ptr_is_owned(htlc);
6582 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
6583 htlc_conv.is_owned = false;
6584 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
6585 *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);
6586 return tag_ptr(ret_conv, true);
6589 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) {
6590 void* this_arg_ptr = untag_ptr(this_arg);
6591 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6592 LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
6593 LDKClosingTransaction closing_tx_conv;
6594 closing_tx_conv.inner = untag_ptr(closing_tx);
6595 closing_tx_conv.is_owned = ptr_is_owned(closing_tx);
6596 CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_conv);
6597 closing_tx_conv.is_owned = false;
6598 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
6599 *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, &closing_tx_conv);
6600 return tag_ptr(ret_conv, true);
6603 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) {
6604 void* this_arg_ptr = untag_ptr(this_arg);
6605 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6606 LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
6607 LDKTransaction anchor_tx_ref;
6608 anchor_tx_ref.datalen = (*env)->GetArrayLength(env, anchor_tx);
6609 anchor_tx_ref.data = MALLOC(anchor_tx_ref.datalen, "LDKTransaction Bytes");
6610 (*env)->GetByteArrayRegion(env, anchor_tx, 0, anchor_tx_ref.datalen, anchor_tx_ref.data);
6611 anchor_tx_ref.data_is_owned = true;
6612 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
6613 *ret_conv = (this_arg_conv->sign_holder_anchor_input)(this_arg_conv->this_arg, anchor_tx_ref, input);
6614 return tag_ptr(ret_conv, true);
6617 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) {
6618 void* this_arg_ptr = untag_ptr(this_arg);
6619 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6620 LDKEcdsaChannelSigner* this_arg_conv = (LDKEcdsaChannelSigner*)this_arg_ptr;
6621 LDKUnsignedChannelAnnouncement msg_conv;
6622 msg_conv.inner = untag_ptr(msg);
6623 msg_conv.is_owned = ptr_is_owned(msg);
6624 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
6625 msg_conv.is_owned = false;
6626 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
6627 *ret_conv = (this_arg_conv->sign_channel_announcement_with_funding_key)(this_arg_conv->this_arg, &msg_conv);
6628 return tag_ptr(ret_conv, true);
6631 typedef struct LDKWriteableEcdsaChannelSigner_JCalls {
6632 atomic_size_t refcnt;
6635 LDKEcdsaChannelSigner_JCalls* EcdsaChannelSigner;
6636 LDKChannelSigner_JCalls* ChannelSigner;
6637 jmethodID write_meth;
6638 } LDKWriteableEcdsaChannelSigner_JCalls;
6639 static void LDKWriteableEcdsaChannelSigner_JCalls_free(void* this_arg) {
6640 LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) this_arg;
6641 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
6643 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6644 if (get_jenv_res == JNI_EDETACHED) {
6645 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6647 DO_ASSERT(get_jenv_res == JNI_OK);
6649 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
6650 if (get_jenv_res == JNI_EDETACHED) {
6651 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6656 LDKCVec_u8Z write_LDKWriteableEcdsaChannelSigner_jcall(const void* this_arg) {
6657 LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) this_arg;
6659 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
6660 if (get_jenv_res == JNI_EDETACHED) {
6661 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
6663 DO_ASSERT(get_jenv_res == JNI_OK);
6665 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
6667 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
6668 if (UNLIKELY((*env)->ExceptionCheck(env))) {
6669 (*env)->ExceptionDescribe(env);
6670 (*env)->FatalError(env, "A call to write in LDKWriteableEcdsaChannelSigner from rust threw an exception.");
6672 LDKCVec_u8Z ret_ref;
6673 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
6674 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
6675 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
6676 if (get_jenv_res == JNI_EDETACHED) {
6677 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
6681 static void LDKWriteableEcdsaChannelSigner_JCalls_cloned(LDKWriteableEcdsaChannelSigner* new_obj) {
6682 LDKWriteableEcdsaChannelSigner_JCalls *j_calls = (LDKWriteableEcdsaChannelSigner_JCalls*) new_obj->this_arg;
6683 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
6684 atomic_fetch_add_explicit(&j_calls->EcdsaChannelSigner->refcnt, 1, memory_order_release);
6685 atomic_fetch_add_explicit(&j_calls->EcdsaChannelSigner->ChannelSigner->refcnt, 1, memory_order_release);
6687 static inline LDKWriteableEcdsaChannelSigner LDKWriteableEcdsaChannelSigner_init (JNIEnv *env, jclass clz, jobject o, jobject EcdsaChannelSigner, jobject ChannelSigner, int64_t pubkeys) {
6688 jclass c = (*env)->GetObjectClass(env, o);
6690 LDKWriteableEcdsaChannelSigner_JCalls *calls = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner_JCalls), "LDKWriteableEcdsaChannelSigner_JCalls");
6691 atomic_init(&calls->refcnt, 1);
6692 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
6693 calls->o = (*env)->NewWeakGlobalRef(env, o);
6694 calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
6695 CHECK(calls->write_meth != NULL);
6697 LDKChannelPublicKeys pubkeys_conv;
6698 pubkeys_conv.inner = untag_ptr(pubkeys);
6699 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
6700 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
6702 LDKWriteableEcdsaChannelSigner ret = {
6703 .this_arg = (void*) calls,
6704 .write = write_LDKWriteableEcdsaChannelSigner_jcall,
6705 .cloned = LDKWriteableEcdsaChannelSigner_JCalls_cloned,
6706 .free = LDKWriteableEcdsaChannelSigner_JCalls_free,
6707 .EcdsaChannelSigner = LDKEcdsaChannelSigner_init(env, clz, EcdsaChannelSigner, ChannelSigner, pubkeys),
6709 calls->EcdsaChannelSigner = ret.EcdsaChannelSigner.this_arg;
6710 calls->ChannelSigner = ret.EcdsaChannelSigner.ChannelSigner.this_arg;
6713 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWriteableEcdsaChannelSigner_1new(JNIEnv *env, jclass clz, jobject o, jobject EcdsaChannelSigner, jobject ChannelSigner, int64_t pubkeys) {
6714 LDKWriteableEcdsaChannelSigner *res_ptr = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner");
6715 *res_ptr = LDKWriteableEcdsaChannelSigner_init(env, clz, o, EcdsaChannelSigner, ChannelSigner, pubkeys);
6716 return tag_ptr(res_ptr, true);
6718 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWriteableEcdsaChannelSigner_1get_1EcdsaChannelSigner(JNIEnv *env, jclass clz, int64_t arg) {
6719 LDKWriteableEcdsaChannelSigner *inp = (LDKWriteableEcdsaChannelSigner *)untag_ptr(arg);
6720 return tag_ptr(&inp->EcdsaChannelSigner, false);
6722 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWriteableEcdsaChannelSigner_1get_1ChannelSigner(JNIEnv *env, jclass clz, int64_t arg) {
6723 LDKWriteableEcdsaChannelSigner *inp = (LDKWriteableEcdsaChannelSigner *)untag_ptr(arg);
6724 return tag_ptr(&inp->EcdsaChannelSigner.ChannelSigner, false);
6726 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
6727 void* this_arg_ptr = untag_ptr(this_arg);
6728 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
6729 LDKWriteableEcdsaChannelSigner* this_arg_conv = (LDKWriteableEcdsaChannelSigner*)this_arg_ptr;
6730 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
6731 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
6732 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
6733 CVec_u8Z_free(ret_var);
6737 static inline struct LDKWriteableEcdsaChannelSigner CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){
6738 CHECK(owner->result_ok);
6739 return WriteableEcdsaChannelSigner_clone(&*owner->contents.result);
6741 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6742 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner);
6743 LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner");
6744 *ret_ret = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_ok(owner_conv);
6745 return tag_ptr(ret_ret, true);
6748 static inline struct LDKDecodeError CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR owner){
6749 CHECK(!owner->result_ok);
6750 return DecodeError_clone(&*owner->contents.err);
6752 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6753 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* owner_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(owner);
6754 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6755 *ret_copy = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_get_err(owner_conv);
6756 int64_t ret_ref = tag_ptr(ret_copy, true);
6760 static inline LDKCVec_CVec_u8ZZ CVec_CVec_u8ZZ_clone(const LDKCVec_CVec_u8ZZ *orig) {
6761 LDKCVec_CVec_u8ZZ ret = { .data = MALLOC(sizeof(LDKCVec_u8Z) * orig->datalen, "LDKCVec_CVec_u8ZZ clone bytes"), .datalen = orig->datalen };
6762 for (size_t i = 0; i < ret.datalen; i++) {
6763 ret.data[i] = CVec_u8Z_clone(&orig->data[i]);
6767 static inline struct LDKCVec_CVec_u8ZZ CResult_CVec_CVec_u8ZZNoneZ_get_ok(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){
6768 CHECK(owner->result_ok);
6769 return CVec_CVec_u8ZZ_clone(&*owner->contents.result);
6771 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6772 LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner);
6773 LDKCVec_CVec_u8ZZ ret_var = CResult_CVec_CVec_u8ZZNoneZ_get_ok(owner_conv);
6774 jobjectArray ret_arr = NULL;
6775 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
6777 for (size_t i = 0; i < ret_var.datalen; i++) {
6778 LDKCVec_u8Z ret_conv_8_var = ret_var.data[i];
6779 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, ret_conv_8_var.datalen);
6780 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, ret_conv_8_var.datalen, ret_conv_8_var.data);
6781 CVec_u8Z_free(ret_conv_8_var);
6782 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
6789 static inline void CResult_CVec_CVec_u8ZZNoneZ_get_err(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){
6790 CHECK(!owner->result_ok);
6791 return *owner->contents.err;
6793 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6794 LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner);
6795 CResult_CVec_CVec_u8ZZNoneZ_get_err(owner_conv);
6798 static inline struct LDKInMemorySigner CResult_InMemorySignerDecodeErrorZ_get_ok(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
6799 LDKInMemorySigner ret = *owner->contents.result;
6800 ret.is_owned = false;
6803 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6804 LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
6805 LDKInMemorySigner ret_var = CResult_InMemorySignerDecodeErrorZ_get_ok(owner_conv);
6806 int64_t ret_ref = 0;
6807 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6808 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6812 static inline struct LDKDecodeError CResult_InMemorySignerDecodeErrorZ_get_err(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
6813 CHECK(!owner->result_ok);
6814 return DecodeError_clone(&*owner->contents.err);
6816 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6817 LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
6818 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
6819 *ret_copy = CResult_InMemorySignerDecodeErrorZ_get_err(owner_conv);
6820 int64_t ret_ref = tag_ptr(ret_copy, true);
6824 static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) {
6825 LDKCVec_TxOutZ ret = { .data = MALLOC(sizeof(LDKTxOut) * orig->datalen, "LDKCVec_TxOutZ clone bytes"), .datalen = orig->datalen };
6826 for (size_t i = 0; i < ret.datalen; i++) {
6827 ret.data[i] = TxOut_clone(&orig->data[i]);
6831 static inline struct LDKTransaction CResult_TransactionNoneZ_get_ok(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){
6832 CHECK(owner->result_ok);
6833 return *owner->contents.result;
6835 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6836 LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner);
6837 LDKTransaction ret_var = CResult_TransactionNoneZ_get_ok(owner_conv);
6838 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
6839 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
6843 static inline void CResult_TransactionNoneZ_get_err(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){
6844 CHECK(!owner->result_ok);
6845 return *owner->contents.err;
6847 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6848 LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner);
6849 CResult_TransactionNoneZ_get_err(owner_conv);
6852 static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner){
6853 return ThirtyTwoBytes_clone(&owner->a);
6855 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
6856 LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(owner);
6857 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6858 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_BlockHashChannelMonitorZ_get_a(owner_conv).data);
6862 static inline struct LDKChannelMonitor C2Tuple_BlockHashChannelMonitorZ_get_b(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner){
6863 LDKChannelMonitor ret = owner->b;
6864 ret.is_owned = false;
6867 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
6868 LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(owner);
6869 LDKChannelMonitor ret_var = C2Tuple_BlockHashChannelMonitorZ_get_b(owner_conv);
6870 int64_t ret_ref = 0;
6871 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6872 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6876 static inline LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CVec_C2Tuple_BlockHashChannelMonitorZZ_clone(const LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *orig) {
6877 LDKCVec_C2Tuple_BlockHashChannelMonitorZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ) * orig->datalen, "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ clone bytes"), .datalen = orig->datalen };
6878 for (size_t i = 0; i < ret.datalen; i++) {
6879 ret.data[i] = C2Tuple_BlockHashChannelMonitorZ_clone(&orig->data[i]);
6883 static inline struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR owner){
6884 CHECK(owner->result_ok);
6885 return CVec_C2Tuple_BlockHashChannelMonitorZZ_clone(&*owner->contents.result);
6887 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6888 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* owner_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(owner);
6889 LDKCVec_C2Tuple_BlockHashChannelMonitorZZ ret_var = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_ok(owner_conv);
6890 int64_tArray ret_arr = NULL;
6891 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
6892 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
6893 for (size_t j = 0; j < ret_var.datalen; j++) {
6894 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv_35_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
6895 *ret_conv_35_conv = ret_var.data[j];
6896 ret_arr_ptr[j] = tag_ptr(ret_conv_35_conv, true);
6898 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
6903 static inline enum LDKIOError CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR owner){
6904 CHECK(!owner->result_ok);
6905 return *owner->contents.err;
6907 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6908 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* owner_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(owner);
6909 jclass ret_conv = LDKIOError_to_java(env, CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_get_err(owner_conv));
6913 static jclass LDKCOption_u16Z_Some_class = NULL;
6914 static jmethodID LDKCOption_u16Z_Some_meth = NULL;
6915 static jclass LDKCOption_u16Z_None_class = NULL;
6916 static jmethodID LDKCOption_u16Z_None_meth = NULL;
6917 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u16Z_init (JNIEnv *env, jclass clz) {
6918 LDKCOption_u16Z_Some_class =
6919 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u16Z$Some"));
6920 CHECK(LDKCOption_u16Z_Some_class != NULL);
6921 LDKCOption_u16Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u16Z_Some_class, "<init>", "(S)V");
6922 CHECK(LDKCOption_u16Z_Some_meth != NULL);
6923 LDKCOption_u16Z_None_class =
6924 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u16Z$None"));
6925 CHECK(LDKCOption_u16Z_None_class != NULL);
6926 LDKCOption_u16Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u16Z_None_class, "<init>", "()V");
6927 CHECK(LDKCOption_u16Z_None_meth != NULL);
6929 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u16Z_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
6930 LDKCOption_u16Z *obj = (LDKCOption_u16Z*)untag_ptr(ptr);
6932 case LDKCOption_u16Z_Some: {
6933 int16_t some_conv = obj->some;
6934 return (*env)->NewObject(env, LDKCOption_u16Z_Some_class, LDKCOption_u16Z_Some_meth, some_conv);
6936 case LDKCOption_u16Z_None: {
6937 return (*env)->NewObject(env, LDKCOption_u16Z_None_class, LDKCOption_u16Z_None_meth);
6942 static inline struct LDKThirtyTwoBytes CResult__u832APIErrorZ_get_ok(LDKCResult__u832APIErrorZ *NONNULL_PTR owner){
6943 CHECK(owner->result_ok);
6944 return ThirtyTwoBytes_clone(&*owner->contents.result);
6946 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
6947 LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(owner);
6948 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
6949 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult__u832APIErrorZ_get_ok(owner_conv).data);
6953 static inline struct LDKAPIError CResult__u832APIErrorZ_get_err(LDKCResult__u832APIErrorZ *NONNULL_PTR owner){
6954 CHECK(!owner->result_ok);
6955 return APIError_clone(&*owner->contents.err);
6957 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
6958 LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(owner);
6959 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
6960 *ret_copy = CResult__u832APIErrorZ_get_err(owner_conv);
6961 int64_t ret_ref = tag_ptr(ret_copy, true);
6965 static jclass LDKRecentPaymentDetails_Pending_class = NULL;
6966 static jmethodID LDKRecentPaymentDetails_Pending_meth = NULL;
6967 static jclass LDKRecentPaymentDetails_Fulfilled_class = NULL;
6968 static jmethodID LDKRecentPaymentDetails_Fulfilled_meth = NULL;
6969 static jclass LDKRecentPaymentDetails_Abandoned_class = NULL;
6970 static jmethodID LDKRecentPaymentDetails_Abandoned_meth = NULL;
6971 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKRecentPaymentDetails_init (JNIEnv *env, jclass clz) {
6972 LDKRecentPaymentDetails_Pending_class =
6973 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRecentPaymentDetails$Pending"));
6974 CHECK(LDKRecentPaymentDetails_Pending_class != NULL);
6975 LDKRecentPaymentDetails_Pending_meth = (*env)->GetMethodID(env, LDKRecentPaymentDetails_Pending_class, "<init>", "([BJ)V");
6976 CHECK(LDKRecentPaymentDetails_Pending_meth != NULL);
6977 LDKRecentPaymentDetails_Fulfilled_class =
6978 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRecentPaymentDetails$Fulfilled"));
6979 CHECK(LDKRecentPaymentDetails_Fulfilled_class != NULL);
6980 LDKRecentPaymentDetails_Fulfilled_meth = (*env)->GetMethodID(env, LDKRecentPaymentDetails_Fulfilled_class, "<init>", "([B)V");
6981 CHECK(LDKRecentPaymentDetails_Fulfilled_meth != NULL);
6982 LDKRecentPaymentDetails_Abandoned_class =
6983 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRecentPaymentDetails$Abandoned"));
6984 CHECK(LDKRecentPaymentDetails_Abandoned_class != NULL);
6985 LDKRecentPaymentDetails_Abandoned_meth = (*env)->GetMethodID(env, LDKRecentPaymentDetails_Abandoned_class, "<init>", "([B)V");
6986 CHECK(LDKRecentPaymentDetails_Abandoned_meth != NULL);
6988 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRecentPaymentDetails_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
6989 LDKRecentPaymentDetails *obj = (LDKRecentPaymentDetails*)untag_ptr(ptr);
6991 case LDKRecentPaymentDetails_Pending: {
6992 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
6993 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->pending.payment_hash.data);
6994 int64_t total_msat_conv = obj->pending.total_msat;
6995 return (*env)->NewObject(env, LDKRecentPaymentDetails_Pending_class, LDKRecentPaymentDetails_Pending_meth, payment_hash_arr, total_msat_conv);
6997 case LDKRecentPaymentDetails_Fulfilled: {
6998 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
6999 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->fulfilled.payment_hash.data);
7000 return (*env)->NewObject(env, LDKRecentPaymentDetails_Fulfilled_class, LDKRecentPaymentDetails_Fulfilled_meth, payment_hash_arr);
7002 case LDKRecentPaymentDetails_Abandoned: {
7003 int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
7004 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->abandoned.payment_hash.data);
7005 return (*env)->NewObject(env, LDKRecentPaymentDetails_Abandoned_class, LDKRecentPaymentDetails_Abandoned_meth, payment_hash_arr);
7010 static inline LDKCVec_RecentPaymentDetailsZ CVec_RecentPaymentDetailsZ_clone(const LDKCVec_RecentPaymentDetailsZ *orig) {
7011 LDKCVec_RecentPaymentDetailsZ ret = { .data = MALLOC(sizeof(LDKRecentPaymentDetails) * orig->datalen, "LDKCVec_RecentPaymentDetailsZ clone bytes"), .datalen = orig->datalen };
7012 for (size_t i = 0; i < ret.datalen; i++) {
7013 ret.data[i] = RecentPaymentDetails_clone(&orig->data[i]);
7017 static jclass LDKPaymentSendFailure_ParameterError_class = NULL;
7018 static jmethodID LDKPaymentSendFailure_ParameterError_meth = NULL;
7019 static jclass LDKPaymentSendFailure_PathParameterError_class = NULL;
7020 static jmethodID LDKPaymentSendFailure_PathParameterError_meth = NULL;
7021 static jclass LDKPaymentSendFailure_AllFailedResendSafe_class = NULL;
7022 static jmethodID LDKPaymentSendFailure_AllFailedResendSafe_meth = NULL;
7023 static jclass LDKPaymentSendFailure_DuplicatePayment_class = NULL;
7024 static jmethodID LDKPaymentSendFailure_DuplicatePayment_meth = NULL;
7025 static jclass LDKPaymentSendFailure_PartialFailure_class = NULL;
7026 static jmethodID LDKPaymentSendFailure_PartialFailure_meth = NULL;
7027 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentSendFailure_init (JNIEnv *env, jclass clz) {
7028 LDKPaymentSendFailure_ParameterError_class =
7029 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$ParameterError"));
7030 CHECK(LDKPaymentSendFailure_ParameterError_class != NULL);
7031 LDKPaymentSendFailure_ParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_ParameterError_class, "<init>", "(J)V");
7032 CHECK(LDKPaymentSendFailure_ParameterError_meth != NULL);
7033 LDKPaymentSendFailure_PathParameterError_class =
7034 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$PathParameterError"));
7035 CHECK(LDKPaymentSendFailure_PathParameterError_class != NULL);
7036 LDKPaymentSendFailure_PathParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PathParameterError_class, "<init>", "([J)V");
7037 CHECK(LDKPaymentSendFailure_PathParameterError_meth != NULL);
7038 LDKPaymentSendFailure_AllFailedResendSafe_class =
7039 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$AllFailedResendSafe"));
7040 CHECK(LDKPaymentSendFailure_AllFailedResendSafe_class != NULL);
7041 LDKPaymentSendFailure_AllFailedResendSafe_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_AllFailedResendSafe_class, "<init>", "([J)V");
7042 CHECK(LDKPaymentSendFailure_AllFailedResendSafe_meth != NULL);
7043 LDKPaymentSendFailure_DuplicatePayment_class =
7044 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$DuplicatePayment"));
7045 CHECK(LDKPaymentSendFailure_DuplicatePayment_class != NULL);
7046 LDKPaymentSendFailure_DuplicatePayment_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_DuplicatePayment_class, "<init>", "()V");
7047 CHECK(LDKPaymentSendFailure_DuplicatePayment_meth != NULL);
7048 LDKPaymentSendFailure_PartialFailure_class =
7049 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$PartialFailure"));
7050 CHECK(LDKPaymentSendFailure_PartialFailure_class != NULL);
7051 LDKPaymentSendFailure_PartialFailure_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PartialFailure_class, "<init>", "([JJ[B)V");
7052 CHECK(LDKPaymentSendFailure_PartialFailure_meth != NULL);
7054 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
7055 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
7057 case LDKPaymentSendFailure_ParameterError: {
7058 int64_t parameter_error_ref = tag_ptr(&obj->parameter_error, false);
7059 return (*env)->NewObject(env, LDKPaymentSendFailure_ParameterError_class, LDKPaymentSendFailure_ParameterError_meth, parameter_error_ref);
7061 case LDKPaymentSendFailure_PathParameterError: {
7062 LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error_var = obj->path_parameter_error;
7063 int64_tArray path_parameter_error_arr = NULL;
7064 path_parameter_error_arr = (*env)->NewLongArray(env, path_parameter_error_var.datalen);
7065 int64_t *path_parameter_error_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, path_parameter_error_arr, NULL);
7066 for (size_t w = 0; w < path_parameter_error_var.datalen; w++) {
7067 LDKCResult_NoneAPIErrorZ* path_parameter_error_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
7068 *path_parameter_error_conv_22_conv = path_parameter_error_var.data[w];
7069 *path_parameter_error_conv_22_conv = CResult_NoneAPIErrorZ_clone(path_parameter_error_conv_22_conv);
7070 path_parameter_error_arr_ptr[w] = tag_ptr(path_parameter_error_conv_22_conv, true);
7072 (*env)->ReleasePrimitiveArrayCritical(env, path_parameter_error_arr, path_parameter_error_arr_ptr, 0);
7073 return (*env)->NewObject(env, LDKPaymentSendFailure_PathParameterError_class, LDKPaymentSendFailure_PathParameterError_meth, path_parameter_error_arr);
7075 case LDKPaymentSendFailure_AllFailedResendSafe: {
7076 LDKCVec_APIErrorZ all_failed_resend_safe_var = obj->all_failed_resend_safe;
7077 int64_tArray all_failed_resend_safe_arr = NULL;
7078 all_failed_resend_safe_arr = (*env)->NewLongArray(env, all_failed_resend_safe_var.datalen);
7079 int64_t *all_failed_resend_safe_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, all_failed_resend_safe_arr, NULL);
7080 for (size_t k = 0; k < all_failed_resend_safe_var.datalen; k++) {
7081 int64_t all_failed_resend_safe_conv_10_ref = tag_ptr(&all_failed_resend_safe_var.data[k], false);
7082 all_failed_resend_safe_arr_ptr[k] = all_failed_resend_safe_conv_10_ref;
7084 (*env)->ReleasePrimitiveArrayCritical(env, all_failed_resend_safe_arr, all_failed_resend_safe_arr_ptr, 0);
7085 return (*env)->NewObject(env, LDKPaymentSendFailure_AllFailedResendSafe_class, LDKPaymentSendFailure_AllFailedResendSafe_meth, all_failed_resend_safe_arr);
7087 case LDKPaymentSendFailure_DuplicatePayment: {
7088 return (*env)->NewObject(env, LDKPaymentSendFailure_DuplicatePayment_class, LDKPaymentSendFailure_DuplicatePayment_meth);
7090 case LDKPaymentSendFailure_PartialFailure: {
7091 LDKCVec_CResult_NoneAPIErrorZZ results_var = obj->partial_failure.results;
7092 int64_tArray results_arr = NULL;
7093 results_arr = (*env)->NewLongArray(env, results_var.datalen);
7094 int64_t *results_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, results_arr, NULL);
7095 for (size_t w = 0; w < results_var.datalen; w++) {
7096 LDKCResult_NoneAPIErrorZ* results_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
7097 *results_conv_22_conv = results_var.data[w];
7098 *results_conv_22_conv = CResult_NoneAPIErrorZ_clone(results_conv_22_conv);
7099 results_arr_ptr[w] = tag_ptr(results_conv_22_conv, true);
7101 (*env)->ReleasePrimitiveArrayCritical(env, results_arr, results_arr_ptr, 0);
7102 LDKRouteParameters failed_paths_retry_var = obj->partial_failure.failed_paths_retry;
7103 int64_t failed_paths_retry_ref = 0;
7104 CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_var);
7105 failed_paths_retry_ref = tag_ptr(failed_paths_retry_var.inner, false);
7106 int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32);
7107 (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, obj->partial_failure.payment_id.data);
7108 return (*env)->NewObject(env, LDKPaymentSendFailure_PartialFailure_class, LDKPaymentSendFailure_PartialFailure_meth, results_arr, failed_paths_retry_ref, payment_id_arr);
7113 static inline void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
7114 CHECK(owner->result_ok);
7115 return *owner->contents.result;
7117 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7118 LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
7119 CResult_NonePaymentSendFailureZ_get_ok(owner_conv);
7122 static inline struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
7123 CHECK(!owner->result_ok);
7124 return PaymentSendFailure_clone(&*owner->contents.err);
7126 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7127 LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
7128 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
7129 *ret_copy = CResult_NonePaymentSendFailureZ_get_err(owner_conv);
7130 int64_t ret_ref = tag_ptr(ret_copy, true);
7134 static inline void CResult_NoneRetryableSendFailureZ_get_ok(LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR owner){
7135 CHECK(owner->result_ok);
7136 return *owner->contents.result;
7138 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7139 LDKCResult_NoneRetryableSendFailureZ* owner_conv = (LDKCResult_NoneRetryableSendFailureZ*)untag_ptr(owner);
7140 CResult_NoneRetryableSendFailureZ_get_ok(owner_conv);
7143 static inline enum LDKRetryableSendFailure CResult_NoneRetryableSendFailureZ_get_err(LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR owner){
7144 CHECK(!owner->result_ok);
7145 return RetryableSendFailure_clone(&*owner->contents.err);
7147 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7148 LDKCResult_NoneRetryableSendFailureZ* owner_conv = (LDKCResult_NoneRetryableSendFailureZ*)untag_ptr(owner);
7149 jclass ret_conv = LDKRetryableSendFailure_to_java(env, CResult_NoneRetryableSendFailureZ_get_err(owner_conv));
7153 static inline struct LDKThirtyTwoBytes CResult_PaymentHashPaymentSendFailureZ_get_ok(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR owner){
7154 CHECK(owner->result_ok);
7155 return ThirtyTwoBytes_clone(&*owner->contents.result);
7157 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7158 LDKCResult_PaymentHashPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(owner);
7159 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7160 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentHashPaymentSendFailureZ_get_ok(owner_conv).data);
7164 static inline struct LDKPaymentSendFailure CResult_PaymentHashPaymentSendFailureZ_get_err(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR owner){
7165 CHECK(!owner->result_ok);
7166 return PaymentSendFailure_clone(&*owner->contents.err);
7168 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7169 LDKCResult_PaymentHashPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(owner);
7170 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
7171 *ret_copy = CResult_PaymentHashPaymentSendFailureZ_get_err(owner_conv);
7172 int64_t ret_ref = tag_ptr(ret_copy, true);
7176 static inline struct LDKThirtyTwoBytes CResult_PaymentHashRetryableSendFailureZ_get_ok(LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR owner){
7177 CHECK(owner->result_ok);
7178 return ThirtyTwoBytes_clone(&*owner->contents.result);
7180 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashRetryableSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7181 LDKCResult_PaymentHashRetryableSendFailureZ* owner_conv = (LDKCResult_PaymentHashRetryableSendFailureZ*)untag_ptr(owner);
7182 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7183 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentHashRetryableSendFailureZ_get_ok(owner_conv).data);
7187 static inline enum LDKRetryableSendFailure CResult_PaymentHashRetryableSendFailureZ_get_err(LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR owner){
7188 CHECK(!owner->result_ok);
7189 return RetryableSendFailure_clone(&*owner->contents.err);
7191 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashRetryableSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7192 LDKCResult_PaymentHashRetryableSendFailureZ* owner_conv = (LDKCResult_PaymentHashRetryableSendFailureZ*)untag_ptr(owner);
7193 jclass ret_conv = LDKRetryableSendFailure_to_java(env, CResult_PaymentHashRetryableSendFailureZ_get_err(owner_conv));
7197 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner){
7198 return ThirtyTwoBytes_clone(&owner->a);
7200 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
7201 LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(owner);
7202 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7203 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_PaymentHashPaymentIdZ_get_a(owner_conv).data);
7207 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner){
7208 return ThirtyTwoBytes_clone(&owner->b);
7210 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
7211 LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(owner);
7212 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7213 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_PaymentHashPaymentIdZ_get_b(owner_conv).data);
7217 static inline struct LDKC2Tuple_PaymentHashPaymentIdZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){
7218 CHECK(owner->result_ok);
7219 return C2Tuple_PaymentHashPaymentIdZ_clone(&*owner->contents.result);
7221 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7222 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(owner);
7223 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
7224 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(owner_conv);
7225 return tag_ptr(ret_conv, true);
7228 static inline struct LDKPaymentSendFailure CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){
7229 CHECK(!owner->result_ok);
7230 return PaymentSendFailure_clone(&*owner->contents.err);
7232 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7233 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(owner);
7234 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
7235 *ret_copy = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(owner_conv);
7236 int64_t ret_ref = tag_ptr(ret_copy, true);
7240 static inline LDKCVec_ThirtyTwoBytesZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_ThirtyTwoBytesZ *orig) {
7241 LDKCVec_ThirtyTwoBytesZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_ThirtyTwoBytesZ clone bytes"), .datalen = orig->datalen };
7242 for (size_t i = 0; i < ret.datalen; i++) {
7243 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
7247 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){
7248 return ThirtyTwoBytes_clone(&owner->a);
7250 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
7251 LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(owner);
7252 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7253 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_PaymentHashPaymentSecretZ_get_a(owner_conv).data);
7257 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_b(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){
7258 return ThirtyTwoBytes_clone(&owner->b);
7260 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
7261 LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(owner);
7262 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7263 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_PaymentHashPaymentSecretZ_get_b(owner_conv).data);
7267 static inline struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){
7268 CHECK(owner->result_ok);
7269 return C2Tuple_PaymentHashPaymentSecretZ_clone(&*owner->contents.result);
7271 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7272 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(owner);
7273 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
7274 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(owner_conv);
7275 return tag_ptr(ret_conv, true);
7278 static inline void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){
7279 CHECK(!owner->result_ok);
7280 return *owner->contents.err;
7282 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7283 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(owner);
7284 CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(owner_conv);
7287 static inline struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){
7288 CHECK(owner->result_ok);
7289 return C2Tuple_PaymentHashPaymentSecretZ_clone(&*owner->contents.result);
7291 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7292 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(owner);
7293 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
7294 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(owner_conv);
7295 return tag_ptr(ret_conv, true);
7298 static inline struct LDKAPIError CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){
7299 CHECK(!owner->result_ok);
7300 return APIError_clone(&*owner->contents.err);
7302 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7303 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(owner);
7304 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
7305 *ret_copy = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(owner_conv);
7306 int64_t ret_ref = tag_ptr(ret_copy, true);
7310 static inline struct LDKThirtyTwoBytes CResult_PaymentSecretNoneZ_get_ok(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner){
7311 CHECK(owner->result_ok);
7312 return ThirtyTwoBytes_clone(&*owner->contents.result);
7314 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7315 LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(owner);
7316 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7317 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentSecretNoneZ_get_ok(owner_conv).data);
7321 static inline void CResult_PaymentSecretNoneZ_get_err(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner){
7322 CHECK(!owner->result_ok);
7323 return *owner->contents.err;
7325 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7326 LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(owner);
7327 CResult_PaymentSecretNoneZ_get_err(owner_conv);
7330 static inline struct LDKThirtyTwoBytes CResult_PaymentSecretAPIErrorZ_get_ok(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner){
7331 CHECK(owner->result_ok);
7332 return ThirtyTwoBytes_clone(&*owner->contents.result);
7334 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7335 LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(owner);
7336 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7337 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentSecretAPIErrorZ_get_ok(owner_conv).data);
7341 static inline struct LDKAPIError CResult_PaymentSecretAPIErrorZ_get_err(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner){
7342 CHECK(!owner->result_ok);
7343 return APIError_clone(&*owner->contents.err);
7345 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7346 LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(owner);
7347 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
7348 *ret_copy = CResult_PaymentSecretAPIErrorZ_get_err(owner_conv);
7349 int64_t ret_ref = tag_ptr(ret_copy, true);
7353 static inline struct LDKThirtyTwoBytes CResult_PaymentPreimageAPIErrorZ_get_ok(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner){
7354 CHECK(owner->result_ok);
7355 return ThirtyTwoBytes_clone(&*owner->contents.result);
7357 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7358 LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(owner);
7359 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7360 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentPreimageAPIErrorZ_get_ok(owner_conv).data);
7364 static inline struct LDKAPIError CResult_PaymentPreimageAPIErrorZ_get_err(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner){
7365 CHECK(!owner->result_ok);
7366 return APIError_clone(&*owner->contents.err);
7368 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7369 LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(owner);
7370 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
7371 *ret_copy = CResult_PaymentPreimageAPIErrorZ_get_err(owner_conv);
7372 int64_t ret_ref = tag_ptr(ret_copy, true);
7376 static inline struct LDKCounterpartyForwardingInfo CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
7377 LDKCounterpartyForwardingInfo ret = *owner->contents.result;
7378 ret.is_owned = false;
7381 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7382 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
7383 LDKCounterpartyForwardingInfo ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(owner_conv);
7384 int64_t ret_ref = 0;
7385 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7386 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7390 static inline struct LDKDecodeError CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
7391 CHECK(!owner->result_ok);
7392 return DecodeError_clone(&*owner->contents.err);
7394 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7395 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
7396 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7397 *ret_copy = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv);
7398 int64_t ret_ref = tag_ptr(ret_copy, true);
7402 static inline struct LDKChannelCounterparty CResult_ChannelCounterpartyDecodeErrorZ_get_ok(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
7403 LDKChannelCounterparty ret = *owner->contents.result;
7404 ret.is_owned = false;
7407 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7408 LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
7409 LDKChannelCounterparty ret_var = CResult_ChannelCounterpartyDecodeErrorZ_get_ok(owner_conv);
7410 int64_t ret_ref = 0;
7411 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7412 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7416 static inline struct LDKDecodeError CResult_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
7417 CHECK(!owner->result_ok);
7418 return DecodeError_clone(&*owner->contents.err);
7420 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7421 LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
7422 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7423 *ret_copy = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv);
7424 int64_t ret_ref = tag_ptr(ret_copy, true);
7428 static inline struct LDKChannelDetails CResult_ChannelDetailsDecodeErrorZ_get_ok(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
7429 LDKChannelDetails ret = *owner->contents.result;
7430 ret.is_owned = false;
7433 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7434 LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
7435 LDKChannelDetails ret_var = CResult_ChannelDetailsDecodeErrorZ_get_ok(owner_conv);
7436 int64_t ret_ref = 0;
7437 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7438 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7442 static inline struct LDKDecodeError CResult_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
7443 CHECK(!owner->result_ok);
7444 return DecodeError_clone(&*owner->contents.err);
7446 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7447 LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
7448 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7449 *ret_copy = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv);
7450 int64_t ret_ref = tag_ptr(ret_copy, true);
7454 static inline struct LDKPhantomRouteHints CResult_PhantomRouteHintsDecodeErrorZ_get_ok(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
7455 LDKPhantomRouteHints ret = *owner->contents.result;
7456 ret.is_owned = false;
7459 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
7460 LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
7461 LDKPhantomRouteHints ret_var = CResult_PhantomRouteHintsDecodeErrorZ_get_ok(owner_conv);
7462 int64_t ret_ref = 0;
7463 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7464 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7468 static inline struct LDKDecodeError CResult_PhantomRouteHintsDecodeErrorZ_get_err(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
7469 CHECK(!owner->result_ok);
7470 return DecodeError_clone(&*owner->contents.err);
7472 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
7473 LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
7474 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
7475 *ret_copy = CResult_PhantomRouteHintsDecodeErrorZ_get_err(owner_conv);
7476 int64_t ret_ref = tag_ptr(ret_copy, true);
7480 static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) {
7481 LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen };
7482 for (size_t i = 0; i < ret.datalen; i++) {
7483 ret.data[i] = ChannelMonitor_clone(&orig->data[i]);
7487 typedef struct LDKWatch_JCalls {
7488 atomic_size_t refcnt;
7491 jmethodID watch_channel_meth;
7492 jmethodID update_channel_meth;
7493 jmethodID release_pending_monitor_events_meth;
7495 static void LDKWatch_JCalls_free(void* this_arg) {
7496 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
7497 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7499 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7500 if (get_jenv_res == JNI_EDETACHED) {
7501 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7503 DO_ASSERT(get_jenv_res == JNI_OK);
7505 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
7506 if (get_jenv_res == JNI_EDETACHED) {
7507 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7512 LDKChannelMonitorUpdateStatus watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
7513 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
7515 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7516 if (get_jenv_res == JNI_EDETACHED) {
7517 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7519 DO_ASSERT(get_jenv_res == JNI_OK);
7521 LDKOutPoint funding_txo_var = funding_txo;
7522 int64_t funding_txo_ref = 0;
7523 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
7524 funding_txo_ref = tag_ptr(funding_txo_var.inner, funding_txo_var.is_owned);
7525 LDKChannelMonitor monitor_var = monitor;
7526 int64_t monitor_ref = 0;
7527 CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var);
7528 monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned);
7529 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7531 jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->watch_channel_meth, funding_txo_ref, monitor_ref);
7532 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7533 (*env)->ExceptionDescribe(env);
7534 (*env)->FatalError(env, "A call to watch_channel in LDKWatch from rust threw an exception.");
7536 LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
7537 if (get_jenv_res == JNI_EDETACHED) {
7538 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7542 LDKChannelMonitorUpdateStatus update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, const LDKChannelMonitorUpdate * update) {
7543 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
7545 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7546 if (get_jenv_res == JNI_EDETACHED) {
7547 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7549 DO_ASSERT(get_jenv_res == JNI_OK);
7551 LDKOutPoint funding_txo_var = funding_txo;
7552 int64_t funding_txo_ref = 0;
7553 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
7554 funding_txo_ref = tag_ptr(funding_txo_var.inner, funding_txo_var.is_owned);
7555 LDKChannelMonitorUpdate update_var = *update;
7556 int64_t update_ref = 0;
7557 update_var = ChannelMonitorUpdate_clone(&update_var);
7558 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
7559 update_ref = tag_ptr(update_var.inner, update_var.is_owned);
7560 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7562 jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->update_channel_meth, funding_txo_ref, update_ref);
7563 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7564 (*env)->ExceptionDescribe(env);
7565 (*env)->FatalError(env, "A call to update_channel in LDKWatch from rust threw an exception.");
7567 LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
7568 if (get_jenv_res == JNI_EDETACHED) {
7569 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7573 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) {
7574 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
7576 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7577 if (get_jenv_res == JNI_EDETACHED) {
7578 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7580 DO_ASSERT(get_jenv_res == JNI_OK);
7582 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7584 int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_pending_monitor_events_meth);
7585 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7586 (*env)->ExceptionDescribe(env);
7587 (*env)->FatalError(env, "A call to release_pending_monitor_events in LDKWatch from rust threw an exception.");
7589 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_constr;
7590 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
7591 if (ret_constr.datalen > 0)
7592 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements");
7594 ret_constr.data = NULL;
7595 int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
7596 for (size_t x = 0; x < ret_constr.datalen; x++) {
7597 int64_t ret_conv_49 = ret_vals[x];
7598 void* ret_conv_49_ptr = untag_ptr(ret_conv_49);
7599 CHECK_ACCESS(ret_conv_49_ptr);
7600 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ ret_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(ret_conv_49_ptr);
7601 FREE(untag_ptr(ret_conv_49));
7602 ret_constr.data[x] = ret_conv_49_conv;
7604 (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
7605 if (get_jenv_res == JNI_EDETACHED) {
7606 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7610 static void LDKWatch_JCalls_cloned(LDKWatch* new_obj) {
7611 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) new_obj->this_arg;
7612 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7614 static inline LDKWatch LDKWatch_init (JNIEnv *env, jclass clz, jobject o) {
7615 jclass c = (*env)->GetObjectClass(env, o);
7617 LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls");
7618 atomic_init(&calls->refcnt, 1);
7619 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
7620 calls->o = (*env)->NewWeakGlobalRef(env, o);
7621 calls->watch_channel_meth = (*env)->GetMethodID(env, c, "watch_channel", "(JJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
7622 CHECK(calls->watch_channel_meth != NULL);
7623 calls->update_channel_meth = (*env)->GetMethodID(env, c, "update_channel", "(JJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
7624 CHECK(calls->update_channel_meth != NULL);
7625 calls->release_pending_monitor_events_meth = (*env)->GetMethodID(env, c, "release_pending_monitor_events", "()[J");
7626 CHECK(calls->release_pending_monitor_events_meth != NULL);
7629 .this_arg = (void*) calls,
7630 .watch_channel = watch_channel_LDKWatch_jcall,
7631 .update_channel = update_channel_LDKWatch_jcall,
7632 .release_pending_monitor_events = release_pending_monitor_events_LDKWatch_jcall,
7633 .free = LDKWatch_JCalls_free,
7637 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKWatch_1new(JNIEnv *env, jclass clz, jobject o) {
7638 LDKWatch *res_ptr = MALLOC(sizeof(LDKWatch), "LDKWatch");
7639 *res_ptr = LDKWatch_init(env, clz, o);
7640 return tag_ptr(res_ptr, true);
7642 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) {
7643 void* this_arg_ptr = untag_ptr(this_arg);
7644 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7645 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
7646 LDKOutPoint funding_txo_conv;
7647 funding_txo_conv.inner = untag_ptr(funding_txo);
7648 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
7649 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
7650 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
7651 LDKChannelMonitor monitor_conv;
7652 monitor_conv.inner = untag_ptr(monitor);
7653 monitor_conv.is_owned = ptr_is_owned(monitor);
7654 CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv);
7655 monitor_conv = ChannelMonitor_clone(&monitor_conv);
7656 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv));
7660 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) {
7661 void* this_arg_ptr = untag_ptr(this_arg);
7662 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7663 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
7664 LDKOutPoint funding_txo_conv;
7665 funding_txo_conv.inner = untag_ptr(funding_txo);
7666 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
7667 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
7668 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
7669 LDKChannelMonitorUpdate update_conv;
7670 update_conv.inner = untag_ptr(update);
7671 update_conv.is_owned = ptr_is_owned(update);
7672 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
7673 update_conv.is_owned = false;
7674 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, &update_conv));
7678 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Watch_1release_1pending_1monitor_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
7679 void* this_arg_ptr = untag_ptr(this_arg);
7680 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7681 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
7682 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg);
7683 int64_tArray ret_arr = NULL;
7684 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
7685 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
7686 for (size_t x = 0; x < ret_var.datalen; x++) {
7687 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv_49_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
7688 *ret_conv_49_conv = ret_var.data[x];
7689 ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true);
7691 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
7696 typedef struct LDKBroadcasterInterface_JCalls {
7697 atomic_size_t refcnt;
7700 jmethodID broadcast_transaction_meth;
7701 } LDKBroadcasterInterface_JCalls;
7702 static void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
7703 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
7704 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7706 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7707 if (get_jenv_res == JNI_EDETACHED) {
7708 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7710 DO_ASSERT(get_jenv_res == JNI_OK);
7712 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
7713 if (get_jenv_res == JNI_EDETACHED) {
7714 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7719 void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, LDKTransaction tx) {
7720 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
7722 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7723 if (get_jenv_res == JNI_EDETACHED) {
7724 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7726 DO_ASSERT(get_jenv_res == JNI_OK);
7728 LDKTransaction tx_var = tx;
7729 int8_tArray tx_arr = (*env)->NewByteArray(env, tx_var.datalen);
7730 (*env)->SetByteArrayRegion(env, tx_arr, 0, tx_var.datalen, tx_var.data);
7731 Transaction_free(tx_var);
7732 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7734 (*env)->CallVoidMethod(env, obj, j_calls->broadcast_transaction_meth, tx_arr);
7735 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7736 (*env)->ExceptionDescribe(env);
7737 (*env)->FatalError(env, "A call to broadcast_transaction in LDKBroadcasterInterface from rust threw an exception.");
7739 if (get_jenv_res == JNI_EDETACHED) {
7740 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7743 static void LDKBroadcasterInterface_JCalls_cloned(LDKBroadcasterInterface* new_obj) {
7744 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) new_obj->this_arg;
7745 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7747 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JNIEnv *env, jclass clz, jobject o) {
7748 jclass c = (*env)->GetObjectClass(env, o);
7750 LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
7751 atomic_init(&calls->refcnt, 1);
7752 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
7753 calls->o = (*env)->NewWeakGlobalRef(env, o);
7754 calls->broadcast_transaction_meth = (*env)->GetMethodID(env, c, "broadcast_transaction", "([B)V");
7755 CHECK(calls->broadcast_transaction_meth != NULL);
7757 LDKBroadcasterInterface ret = {
7758 .this_arg = (void*) calls,
7759 .broadcast_transaction = broadcast_transaction_LDKBroadcasterInterface_jcall,
7760 .free = LDKBroadcasterInterface_JCalls_free,
7764 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new(JNIEnv *env, jclass clz, jobject o) {
7765 LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface");
7766 *res_ptr = LDKBroadcasterInterface_init(env, clz, o);
7767 return tag_ptr(res_ptr, true);
7769 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1broadcast_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray tx) {
7770 void* this_arg_ptr = untag_ptr(this_arg);
7771 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7772 LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg_ptr;
7773 LDKTransaction tx_ref;
7774 tx_ref.datalen = (*env)->GetArrayLength(env, tx);
7775 tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes");
7776 (*env)->GetByteArrayRegion(env, tx, 0, tx_ref.datalen, tx_ref.data);
7777 tx_ref.data_is_owned = true;
7778 (this_arg_conv->broadcast_transaction)(this_arg_conv->this_arg, tx_ref);
7781 typedef struct LDKEntropySource_JCalls {
7782 atomic_size_t refcnt;
7785 jmethodID get_secure_random_bytes_meth;
7786 } LDKEntropySource_JCalls;
7787 static void LDKEntropySource_JCalls_free(void* this_arg) {
7788 LDKEntropySource_JCalls *j_calls = (LDKEntropySource_JCalls*) this_arg;
7789 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7791 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7792 if (get_jenv_res == JNI_EDETACHED) {
7793 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7795 DO_ASSERT(get_jenv_res == JNI_OK);
7797 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
7798 if (get_jenv_res == JNI_EDETACHED) {
7799 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7804 LDKThirtyTwoBytes get_secure_random_bytes_LDKEntropySource_jcall(const void* this_arg) {
7805 LDKEntropySource_JCalls *j_calls = (LDKEntropySource_JCalls*) this_arg;
7807 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7808 if (get_jenv_res == JNI_EDETACHED) {
7809 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7811 DO_ASSERT(get_jenv_res == JNI_OK);
7813 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7815 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_secure_random_bytes_meth);
7816 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7817 (*env)->ExceptionDescribe(env);
7818 (*env)->FatalError(env, "A call to get_secure_random_bytes in LDKEntropySource from rust threw an exception.");
7820 LDKThirtyTwoBytes ret_ref;
7821 CHECK((*env)->GetArrayLength(env, ret) == 32);
7822 (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
7823 if (get_jenv_res == JNI_EDETACHED) {
7824 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7828 static void LDKEntropySource_JCalls_cloned(LDKEntropySource* new_obj) {
7829 LDKEntropySource_JCalls *j_calls = (LDKEntropySource_JCalls*) new_obj->this_arg;
7830 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7832 static inline LDKEntropySource LDKEntropySource_init (JNIEnv *env, jclass clz, jobject o) {
7833 jclass c = (*env)->GetObjectClass(env, o);
7835 LDKEntropySource_JCalls *calls = MALLOC(sizeof(LDKEntropySource_JCalls), "LDKEntropySource_JCalls");
7836 atomic_init(&calls->refcnt, 1);
7837 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
7838 calls->o = (*env)->NewWeakGlobalRef(env, o);
7839 calls->get_secure_random_bytes_meth = (*env)->GetMethodID(env, c, "get_secure_random_bytes", "()[B");
7840 CHECK(calls->get_secure_random_bytes_meth != NULL);
7842 LDKEntropySource ret = {
7843 .this_arg = (void*) calls,
7844 .get_secure_random_bytes = get_secure_random_bytes_LDKEntropySource_jcall,
7845 .free = LDKEntropySource_JCalls_free,
7849 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKEntropySource_1new(JNIEnv *env, jclass clz, jobject o) {
7850 LDKEntropySource *res_ptr = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource");
7851 *res_ptr = LDKEntropySource_init(env, clz, o);
7852 return tag_ptr(res_ptr, true);
7854 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_EntropySource_1get_1secure_1random_1bytes(JNIEnv *env, jclass clz, int64_t this_arg) {
7855 void* this_arg_ptr = untag_ptr(this_arg);
7856 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7857 LDKEntropySource* this_arg_conv = (LDKEntropySource*)this_arg_ptr;
7858 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
7859 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data);
7863 static jclass LDKUnsignedGossipMessage_ChannelAnnouncement_class = NULL;
7864 static jmethodID LDKUnsignedGossipMessage_ChannelAnnouncement_meth = NULL;
7865 static jclass LDKUnsignedGossipMessage_ChannelUpdate_class = NULL;
7866 static jmethodID LDKUnsignedGossipMessage_ChannelUpdate_meth = NULL;
7867 static jclass LDKUnsignedGossipMessage_NodeAnnouncement_class = NULL;
7868 static jmethodID LDKUnsignedGossipMessage_NodeAnnouncement_meth = NULL;
7869 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKUnsignedGossipMessage_init (JNIEnv *env, jclass clz) {
7870 LDKUnsignedGossipMessage_ChannelAnnouncement_class =
7871 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKUnsignedGossipMessage$ChannelAnnouncement"));
7872 CHECK(LDKUnsignedGossipMessage_ChannelAnnouncement_class != NULL);
7873 LDKUnsignedGossipMessage_ChannelAnnouncement_meth = (*env)->GetMethodID(env, LDKUnsignedGossipMessage_ChannelAnnouncement_class, "<init>", "(J)V");
7874 CHECK(LDKUnsignedGossipMessage_ChannelAnnouncement_meth != NULL);
7875 LDKUnsignedGossipMessage_ChannelUpdate_class =
7876 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKUnsignedGossipMessage$ChannelUpdate"));
7877 CHECK(LDKUnsignedGossipMessage_ChannelUpdate_class != NULL);
7878 LDKUnsignedGossipMessage_ChannelUpdate_meth = (*env)->GetMethodID(env, LDKUnsignedGossipMessage_ChannelUpdate_class, "<init>", "(J)V");
7879 CHECK(LDKUnsignedGossipMessage_ChannelUpdate_meth != NULL);
7880 LDKUnsignedGossipMessage_NodeAnnouncement_class =
7881 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKUnsignedGossipMessage$NodeAnnouncement"));
7882 CHECK(LDKUnsignedGossipMessage_NodeAnnouncement_class != NULL);
7883 LDKUnsignedGossipMessage_NodeAnnouncement_meth = (*env)->GetMethodID(env, LDKUnsignedGossipMessage_NodeAnnouncement_class, "<init>", "(J)V");
7884 CHECK(LDKUnsignedGossipMessage_NodeAnnouncement_meth != NULL);
7886 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKUnsignedGossipMessage_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
7887 LDKUnsignedGossipMessage *obj = (LDKUnsignedGossipMessage*)untag_ptr(ptr);
7889 case LDKUnsignedGossipMessage_ChannelAnnouncement: {
7890 LDKUnsignedChannelAnnouncement channel_announcement_var = obj->channel_announcement;
7891 int64_t channel_announcement_ref = 0;
7892 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_announcement_var);
7893 channel_announcement_ref = tag_ptr(channel_announcement_var.inner, false);
7894 return (*env)->NewObject(env, LDKUnsignedGossipMessage_ChannelAnnouncement_class, LDKUnsignedGossipMessage_ChannelAnnouncement_meth, channel_announcement_ref);
7896 case LDKUnsignedGossipMessage_ChannelUpdate: {
7897 LDKUnsignedChannelUpdate channel_update_var = obj->channel_update;
7898 int64_t channel_update_ref = 0;
7899 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_update_var);
7900 channel_update_ref = tag_ptr(channel_update_var.inner, false);
7901 return (*env)->NewObject(env, LDKUnsignedGossipMessage_ChannelUpdate_class, LDKUnsignedGossipMessage_ChannelUpdate_meth, channel_update_ref);
7903 case LDKUnsignedGossipMessage_NodeAnnouncement: {
7904 LDKUnsignedNodeAnnouncement node_announcement_var = obj->node_announcement;
7905 int64_t node_announcement_ref = 0;
7906 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_announcement_var);
7907 node_announcement_ref = tag_ptr(node_announcement_var.inner, false);
7908 return (*env)->NewObject(env, LDKUnsignedGossipMessage_NodeAnnouncement_class, LDKUnsignedGossipMessage_NodeAnnouncement_meth, node_announcement_ref);
7913 typedef struct LDKNodeSigner_JCalls {
7914 atomic_size_t refcnt;
7917 jmethodID get_inbound_payment_key_material_meth;
7918 jmethodID get_node_id_meth;
7919 jmethodID ecdh_meth;
7920 jmethodID sign_invoice_meth;
7921 jmethodID sign_gossip_message_meth;
7922 } LDKNodeSigner_JCalls;
7923 static void LDKNodeSigner_JCalls_free(void* this_arg) {
7924 LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg;
7925 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7927 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7928 if (get_jenv_res == JNI_EDETACHED) {
7929 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7931 DO_ASSERT(get_jenv_res == JNI_OK);
7933 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
7934 if (get_jenv_res == JNI_EDETACHED) {
7935 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7940 LDKThirtyTwoBytes get_inbound_payment_key_material_LDKNodeSigner_jcall(const void* this_arg) {
7941 LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg;
7943 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7944 if (get_jenv_res == JNI_EDETACHED) {
7945 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7947 DO_ASSERT(get_jenv_res == JNI_OK);
7949 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7951 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_inbound_payment_key_material_meth);
7952 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7953 (*env)->ExceptionDescribe(env);
7954 (*env)->FatalError(env, "A call to get_inbound_payment_key_material in LDKNodeSigner from rust threw an exception.");
7956 LDKThirtyTwoBytes ret_ref;
7957 CHECK((*env)->GetArrayLength(env, ret) == 32);
7958 (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
7959 if (get_jenv_res == JNI_EDETACHED) {
7960 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7964 LDKCResult_PublicKeyNoneZ get_node_id_LDKNodeSigner_jcall(const void* this_arg, LDKRecipient recipient) {
7965 LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg;
7967 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7968 if (get_jenv_res == JNI_EDETACHED) {
7969 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7971 DO_ASSERT(get_jenv_res == JNI_OK);
7973 jclass recipient_conv = LDKRecipient_to_java(env, recipient);
7974 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
7976 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_node_id_meth, recipient_conv);
7977 if (UNLIKELY((*env)->ExceptionCheck(env))) {
7978 (*env)->ExceptionDescribe(env);
7979 (*env)->FatalError(env, "A call to get_node_id in LDKNodeSigner from rust threw an exception.");
7981 void* ret_ptr = untag_ptr(ret);
7982 CHECK_ACCESS(ret_ptr);
7983 LDKCResult_PublicKeyNoneZ ret_conv = *(LDKCResult_PublicKeyNoneZ*)(ret_ptr);
7984 FREE(untag_ptr(ret));
7985 if (get_jenv_res == JNI_EDETACHED) {
7986 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
7990 LDKCResult_SharedSecretNoneZ ecdh_LDKNodeSigner_jcall(const void* this_arg, LDKRecipient recipient, LDKPublicKey other_key, LDKCOption_ScalarZ tweak) {
7991 LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg;
7993 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
7994 if (get_jenv_res == JNI_EDETACHED) {
7995 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
7997 DO_ASSERT(get_jenv_res == JNI_OK);
7999 jclass recipient_conv = LDKRecipient_to_java(env, recipient);
8000 int8_tArray other_key_arr = (*env)->NewByteArray(env, 33);
8001 (*env)->SetByteArrayRegion(env, other_key_arr, 0, 33, other_key.compressed_form);
8002 LDKCOption_ScalarZ *tweak_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
8003 *tweak_copy = tweak;
8004 int64_t tweak_ref = tag_ptr(tweak_copy, true);
8005 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8007 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->ecdh_meth, recipient_conv, other_key_arr, tweak_ref);
8008 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8009 (*env)->ExceptionDescribe(env);
8010 (*env)->FatalError(env, "A call to ecdh in LDKNodeSigner from rust threw an exception.");
8012 void* ret_ptr = untag_ptr(ret);
8013 CHECK_ACCESS(ret_ptr);
8014 LDKCResult_SharedSecretNoneZ ret_conv = *(LDKCResult_SharedSecretNoneZ*)(ret_ptr);
8015 FREE(untag_ptr(ret));
8016 if (get_jenv_res == JNI_EDETACHED) {
8017 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8021 LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKNodeSigner_jcall(const void* this_arg, LDKu8slice hrp_bytes, LDKCVec_U5Z invoice_data, LDKRecipient recipient) {
8022 LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg;
8024 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8025 if (get_jenv_res == JNI_EDETACHED) {
8026 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8028 DO_ASSERT(get_jenv_res == JNI_OK);
8030 LDKu8slice hrp_bytes_var = hrp_bytes;
8031 int8_tArray hrp_bytes_arr = (*env)->NewByteArray(env, hrp_bytes_var.datalen);
8032 (*env)->SetByteArrayRegion(env, hrp_bytes_arr, 0, hrp_bytes_var.datalen, hrp_bytes_var.data);
8033 LDKCVec_U5Z invoice_data_var = invoice_data;
8034 jobjectArray invoice_data_arr = NULL;
8035 invoice_data_arr = (*env)->NewByteArray(env, invoice_data_var.datalen);
8036 int8_t *invoice_data_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, invoice_data_arr, NULL);
8037 for (size_t h = 0; h < invoice_data_var.datalen; h++) {
8038 uint8_t invoice_data_conv_7_val = invoice_data_var.data[h]._0;
8039 invoice_data_arr_ptr[h] = invoice_data_conv_7_val;
8041 (*env)->ReleasePrimitiveArrayCritical(env, invoice_data_arr, invoice_data_arr_ptr, 0);
8042 FREE(invoice_data_var.data);
8043 jclass recipient_conv = LDKRecipient_to_java(env, recipient);
8044 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8046 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_invoice_meth, hrp_bytes_arr, invoice_data_arr, recipient_conv);
8047 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8048 (*env)->ExceptionDescribe(env);
8049 (*env)->FatalError(env, "A call to sign_invoice in LDKNodeSigner from rust threw an exception.");
8051 void* ret_ptr = untag_ptr(ret);
8052 CHECK_ACCESS(ret_ptr);
8053 LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr);
8054 FREE(untag_ptr(ret));
8055 if (get_jenv_res == JNI_EDETACHED) {
8056 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8060 LDKCResult_SignatureNoneZ sign_gossip_message_LDKNodeSigner_jcall(const void* this_arg, LDKUnsignedGossipMessage msg) {
8061 LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg;
8063 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8064 if (get_jenv_res == JNI_EDETACHED) {
8065 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8067 DO_ASSERT(get_jenv_res == JNI_OK);
8069 LDKUnsignedGossipMessage *msg_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage");
8071 int64_t msg_ref = tag_ptr(msg_copy, true);
8072 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8074 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_gossip_message_meth, msg_ref);
8075 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8076 (*env)->ExceptionDescribe(env);
8077 (*env)->FatalError(env, "A call to sign_gossip_message in LDKNodeSigner from rust threw an exception.");
8079 void* ret_ptr = untag_ptr(ret);
8080 CHECK_ACCESS(ret_ptr);
8081 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
8082 FREE(untag_ptr(ret));
8083 if (get_jenv_res == JNI_EDETACHED) {
8084 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8088 static void LDKNodeSigner_JCalls_cloned(LDKNodeSigner* new_obj) {
8089 LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) new_obj->this_arg;
8090 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8092 static inline LDKNodeSigner LDKNodeSigner_init (JNIEnv *env, jclass clz, jobject o) {
8093 jclass c = (*env)->GetObjectClass(env, o);
8095 LDKNodeSigner_JCalls *calls = MALLOC(sizeof(LDKNodeSigner_JCalls), "LDKNodeSigner_JCalls");
8096 atomic_init(&calls->refcnt, 1);
8097 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
8098 calls->o = (*env)->NewWeakGlobalRef(env, o);
8099 calls->get_inbound_payment_key_material_meth = (*env)->GetMethodID(env, c, "get_inbound_payment_key_material", "()[B");
8100 CHECK(calls->get_inbound_payment_key_material_meth != NULL);
8101 calls->get_node_id_meth = (*env)->GetMethodID(env, c, "get_node_id", "(Lorg/ldk/enums/Recipient;)J");
8102 CHECK(calls->get_node_id_meth != NULL);
8103 calls->ecdh_meth = (*env)->GetMethodID(env, c, "ecdh", "(Lorg/ldk/enums/Recipient;[BJ)J");
8104 CHECK(calls->ecdh_meth != NULL);
8105 calls->sign_invoice_meth = (*env)->GetMethodID(env, c, "sign_invoice", "([B[BLorg/ldk/enums/Recipient;)J");
8106 CHECK(calls->sign_invoice_meth != NULL);
8107 calls->sign_gossip_message_meth = (*env)->GetMethodID(env, c, "sign_gossip_message", "(J)J");
8108 CHECK(calls->sign_gossip_message_meth != NULL);
8110 LDKNodeSigner ret = {
8111 .this_arg = (void*) calls,
8112 .get_inbound_payment_key_material = get_inbound_payment_key_material_LDKNodeSigner_jcall,
8113 .get_node_id = get_node_id_LDKNodeSigner_jcall,
8114 .ecdh = ecdh_LDKNodeSigner_jcall,
8115 .sign_invoice = sign_invoice_LDKNodeSigner_jcall,
8116 .sign_gossip_message = sign_gossip_message_LDKNodeSigner_jcall,
8117 .free = LDKNodeSigner_JCalls_free,
8121 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKNodeSigner_1new(JNIEnv *env, jclass clz, jobject o) {
8122 LDKNodeSigner *res_ptr = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner");
8123 *res_ptr = LDKNodeSigner_init(env, clz, o);
8124 return tag_ptr(res_ptr, true);
8126 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeSigner_1get_1inbound_1payment_1key_1material(JNIEnv *env, jclass clz, int64_t this_arg) {
8127 void* this_arg_ptr = untag_ptr(this_arg);
8128 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8129 LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr;
8130 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
8131 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->get_inbound_payment_key_material)(this_arg_conv->this_arg).data);
8135 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg, jclass recipient) {
8136 void* this_arg_ptr = untag_ptr(this_arg);
8137 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8138 LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr;
8139 LDKRecipient recipient_conv = LDKRecipient_from_java(env, recipient);
8140 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
8141 *ret_conv = (this_arg_conv->get_node_id)(this_arg_conv->this_arg, recipient_conv);
8142 return tag_ptr(ret_conv, true);
8145 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) {
8146 void* this_arg_ptr = untag_ptr(this_arg);
8147 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8148 LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr;
8149 LDKRecipient recipient_conv = LDKRecipient_from_java(env, recipient);
8150 LDKPublicKey other_key_ref;
8151 CHECK((*env)->GetArrayLength(env, other_key) == 33);
8152 (*env)->GetByteArrayRegion(env, other_key, 0, 33, other_key_ref.compressed_form);
8153 void* tweak_ptr = untag_ptr(tweak);
8154 CHECK_ACCESS(tweak_ptr);
8155 LDKCOption_ScalarZ tweak_conv = *(LDKCOption_ScalarZ*)(tweak_ptr);
8156 tweak_conv = COption_ScalarZ_clone((LDKCOption_ScalarZ*)untag_ptr(tweak));
8157 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
8158 *ret_conv = (this_arg_conv->ecdh)(this_arg_conv->this_arg, recipient_conv, other_key_ref, tweak_conv);
8159 return tag_ptr(ret_conv, true);
8162 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) {
8163 void* this_arg_ptr = untag_ptr(this_arg);
8164 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8165 LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr;
8166 LDKu8slice hrp_bytes_ref;
8167 hrp_bytes_ref.datalen = (*env)->GetArrayLength(env, hrp_bytes);
8168 hrp_bytes_ref.data = (*env)->GetByteArrayElements (env, hrp_bytes, NULL);
8169 LDKCVec_U5Z invoice_data_constr;
8170 invoice_data_constr.datalen = (*env)->GetArrayLength(env, invoice_data);
8171 if (invoice_data_constr.datalen > 0)
8172 invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements");
8174 invoice_data_constr.data = NULL;
8175 int8_t* invoice_data_vals = (*env)->GetByteArrayElements (env, invoice_data, NULL);
8176 for (size_t h = 0; h < invoice_data_constr.datalen; h++) {
8177 int8_t invoice_data_conv_7 = invoice_data_vals[h];
8179 invoice_data_constr.data[h] = (LDKU5){ ._0 = invoice_data_conv_7 };
8181 (*env)->ReleaseByteArrayElements(env, invoice_data, invoice_data_vals, 0);
8182 LDKRecipient recipient_conv = LDKRecipient_from_java(env, recipient);
8183 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
8184 *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, hrp_bytes_ref, invoice_data_constr, recipient_conv);
8185 (*env)->ReleaseByteArrayElements(env, hrp_bytes, (int8_t*)hrp_bytes_ref.data, 0);
8186 return tag_ptr(ret_conv, true);
8189 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1sign_1gossip_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
8190 void* this_arg_ptr = untag_ptr(this_arg);
8191 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8192 LDKNodeSigner* this_arg_conv = (LDKNodeSigner*)this_arg_ptr;
8193 void* msg_ptr = untag_ptr(msg);
8194 CHECK_ACCESS(msg_ptr);
8195 LDKUnsignedGossipMessage msg_conv = *(LDKUnsignedGossipMessage*)(msg_ptr);
8196 msg_conv = UnsignedGossipMessage_clone((LDKUnsignedGossipMessage*)untag_ptr(msg));
8197 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
8198 *ret_conv = (this_arg_conv->sign_gossip_message)(this_arg_conv->this_arg, msg_conv);
8199 return tag_ptr(ret_conv, true);
8202 typedef struct LDKSignerProvider_JCalls {
8203 atomic_size_t refcnt;
8206 jmethodID generate_channel_keys_id_meth;
8207 jmethodID derive_channel_signer_meth;
8208 jmethodID read_chan_signer_meth;
8209 jmethodID get_destination_script_meth;
8210 jmethodID get_shutdown_scriptpubkey_meth;
8211 } LDKSignerProvider_JCalls;
8212 static void LDKSignerProvider_JCalls_free(void* this_arg) {
8213 LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg;
8214 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8216 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8217 if (get_jenv_res == JNI_EDETACHED) {
8218 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8220 DO_ASSERT(get_jenv_res == JNI_OK);
8222 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
8223 if (get_jenv_res == JNI_EDETACHED) {
8224 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8229 LDKThirtyTwoBytes generate_channel_keys_id_LDKSignerProvider_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis, LDKU128 user_channel_id) {
8230 LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg;
8232 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8233 if (get_jenv_res == JNI_EDETACHED) {
8234 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8236 DO_ASSERT(get_jenv_res == JNI_OK);
8238 jboolean inbound_conv = inbound;
8239 int64_t channel_value_satoshis_conv = channel_value_satoshis;
8240 int8_tArray user_channel_id_arr = (*env)->NewByteArray(env, 16);
8241 (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, user_channel_id.le_bytes);
8242 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8244 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->generate_channel_keys_id_meth, inbound_conv, channel_value_satoshis_conv, user_channel_id_arr);
8245 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8246 (*env)->ExceptionDescribe(env);
8247 (*env)->FatalError(env, "A call to generate_channel_keys_id in LDKSignerProvider from rust threw an exception.");
8249 LDKThirtyTwoBytes ret_ref;
8250 CHECK((*env)->GetArrayLength(env, ret) == 32);
8251 (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data);
8252 if (get_jenv_res == JNI_EDETACHED) {
8253 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8257 LDKWriteableEcdsaChannelSigner derive_channel_signer_LDKSignerProvider_jcall(const void* this_arg, uint64_t channel_value_satoshis, LDKThirtyTwoBytes channel_keys_id) {
8258 LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg;
8260 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8261 if (get_jenv_res == JNI_EDETACHED) {
8262 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8264 DO_ASSERT(get_jenv_res == JNI_OK);
8266 int64_t channel_value_satoshis_conv = channel_value_satoshis;
8267 int8_tArray channel_keys_id_arr = (*env)->NewByteArray(env, 32);
8268 (*env)->SetByteArrayRegion(env, channel_keys_id_arr, 0, 32, channel_keys_id.data);
8269 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8271 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->derive_channel_signer_meth, channel_value_satoshis_conv, channel_keys_id_arr);
8272 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8273 (*env)->ExceptionDescribe(env);
8274 (*env)->FatalError(env, "A call to derive_channel_signer in LDKSignerProvider from rust threw an exception.");
8276 void* ret_ptr = untag_ptr(ret);
8277 CHECK_ACCESS(ret_ptr);
8278 LDKWriteableEcdsaChannelSigner ret_conv = *(LDKWriteableEcdsaChannelSigner*)(ret_ptr);
8279 FREE(untag_ptr(ret));
8280 if (get_jenv_res == JNI_EDETACHED) {
8281 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8285 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ read_chan_signer_LDKSignerProvider_jcall(const void* this_arg, LDKu8slice reader) {
8286 LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg;
8288 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8289 if (get_jenv_res == JNI_EDETACHED) {
8290 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8292 DO_ASSERT(get_jenv_res == JNI_OK);
8294 LDKu8slice reader_var = reader;
8295 int8_tArray reader_arr = (*env)->NewByteArray(env, reader_var.datalen);
8296 (*env)->SetByteArrayRegion(env, reader_arr, 0, reader_var.datalen, reader_var.data);
8297 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8299 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->read_chan_signer_meth, reader_arr);
8300 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8301 (*env)->ExceptionDescribe(env);
8302 (*env)->FatalError(env, "A call to read_chan_signer in LDKSignerProvider from rust threw an exception.");
8304 void* ret_ptr = untag_ptr(ret);
8305 CHECK_ACCESS(ret_ptr);
8306 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ ret_conv = *(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)(ret_ptr);
8307 FREE(untag_ptr(ret));
8308 if (get_jenv_res == JNI_EDETACHED) {
8309 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8313 LDKCVec_u8Z get_destination_script_LDKSignerProvider_jcall(const void* this_arg) {
8314 LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg;
8316 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8317 if (get_jenv_res == JNI_EDETACHED) {
8318 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8320 DO_ASSERT(get_jenv_res == JNI_OK);
8322 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8324 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_destination_script_meth);
8325 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8326 (*env)->ExceptionDescribe(env);
8327 (*env)->FatalError(env, "A call to get_destination_script in LDKSignerProvider from rust threw an exception.");
8329 LDKCVec_u8Z ret_ref;
8330 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
8331 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
8332 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
8333 if (get_jenv_res == JNI_EDETACHED) {
8334 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8338 LDKShutdownScript get_shutdown_scriptpubkey_LDKSignerProvider_jcall(const void* this_arg) {
8339 LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) this_arg;
8341 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8342 if (get_jenv_res == JNI_EDETACHED) {
8343 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8345 DO_ASSERT(get_jenv_res == JNI_OK);
8347 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8349 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_shutdown_scriptpubkey_meth);
8350 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8351 (*env)->ExceptionDescribe(env);
8352 (*env)->FatalError(env, "A call to get_shutdown_scriptpubkey in LDKSignerProvider from rust threw an exception.");
8354 LDKShutdownScript ret_conv;
8355 ret_conv.inner = untag_ptr(ret);
8356 ret_conv.is_owned = ptr_is_owned(ret);
8357 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
8358 if (get_jenv_res == JNI_EDETACHED) {
8359 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8363 static void LDKSignerProvider_JCalls_cloned(LDKSignerProvider* new_obj) {
8364 LDKSignerProvider_JCalls *j_calls = (LDKSignerProvider_JCalls*) new_obj->this_arg;
8365 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8367 static inline LDKSignerProvider LDKSignerProvider_init (JNIEnv *env, jclass clz, jobject o) {
8368 jclass c = (*env)->GetObjectClass(env, o);
8370 LDKSignerProvider_JCalls *calls = MALLOC(sizeof(LDKSignerProvider_JCalls), "LDKSignerProvider_JCalls");
8371 atomic_init(&calls->refcnt, 1);
8372 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
8373 calls->o = (*env)->NewWeakGlobalRef(env, o);
8374 calls->generate_channel_keys_id_meth = (*env)->GetMethodID(env, c, "generate_channel_keys_id", "(ZJ[B)[B");
8375 CHECK(calls->generate_channel_keys_id_meth != NULL);
8376 calls->derive_channel_signer_meth = (*env)->GetMethodID(env, c, "derive_channel_signer", "(J[B)J");
8377 CHECK(calls->derive_channel_signer_meth != NULL);
8378 calls->read_chan_signer_meth = (*env)->GetMethodID(env, c, "read_chan_signer", "([B)J");
8379 CHECK(calls->read_chan_signer_meth != NULL);
8380 calls->get_destination_script_meth = (*env)->GetMethodID(env, c, "get_destination_script", "()[B");
8381 CHECK(calls->get_destination_script_meth != NULL);
8382 calls->get_shutdown_scriptpubkey_meth = (*env)->GetMethodID(env, c, "get_shutdown_scriptpubkey", "()J");
8383 CHECK(calls->get_shutdown_scriptpubkey_meth != NULL);
8385 LDKSignerProvider ret = {
8386 .this_arg = (void*) calls,
8387 .generate_channel_keys_id = generate_channel_keys_id_LDKSignerProvider_jcall,
8388 .derive_channel_signer = derive_channel_signer_LDKSignerProvider_jcall,
8389 .read_chan_signer = read_chan_signer_LDKSignerProvider_jcall,
8390 .get_destination_script = get_destination_script_LDKSignerProvider_jcall,
8391 .get_shutdown_scriptpubkey = get_shutdown_scriptpubkey_LDKSignerProvider_jcall,
8392 .free = LDKSignerProvider_JCalls_free,
8396 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKSignerProvider_1new(JNIEnv *env, jclass clz, jobject o) {
8397 LDKSignerProvider *res_ptr = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider");
8398 *res_ptr = LDKSignerProvider_init(env, clz, o);
8399 return tag_ptr(res_ptr, true);
8401 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) {
8402 void* this_arg_ptr = untag_ptr(this_arg);
8403 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8404 LDKSignerProvider* this_arg_conv = (LDKSignerProvider*)this_arg_ptr;
8405 LDKU128 user_channel_id_ref;
8406 CHECK((*env)->GetArrayLength(env, user_channel_id) == 16);
8407 (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes);
8408 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
8409 (*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);
8413 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) {
8414 void* this_arg_ptr = untag_ptr(this_arg);
8415 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8416 LDKSignerProvider* this_arg_conv = (LDKSignerProvider*)this_arg_ptr;
8417 LDKThirtyTwoBytes channel_keys_id_ref;
8418 CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32);
8419 (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data);
8420 LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner");
8421 *ret_ret = (this_arg_conv->derive_channel_signer)(this_arg_conv->this_arg, channel_value_satoshis, channel_keys_id_ref);
8422 return tag_ptr(ret_ret, true);
8425 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignerProvider_1read_1chan_1signer(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray reader) {
8426 void* this_arg_ptr = untag_ptr(this_arg);
8427 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8428 LDKSignerProvider* this_arg_conv = (LDKSignerProvider*)this_arg_ptr;
8429 LDKu8slice reader_ref;
8430 reader_ref.datalen = (*env)->GetArrayLength(env, reader);
8431 reader_ref.data = (*env)->GetByteArrayElements (env, reader, NULL);
8432 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ");
8433 *ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref);
8434 (*env)->ReleaseByteArrayElements(env, reader, (int8_t*)reader_ref.data, 0);
8435 return tag_ptr(ret_conv, true);
8438 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SignerProvider_1get_1destination_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
8439 void* this_arg_ptr = untag_ptr(this_arg);
8440 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8441 LDKSignerProvider* this_arg_conv = (LDKSignerProvider*)this_arg_ptr;
8442 LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg);
8443 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
8444 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
8445 CVec_u8Z_free(ret_var);
8449 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignerProvider_1get_1shutdown_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_arg) {
8450 void* this_arg_ptr = untag_ptr(this_arg);
8451 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8452 LDKSignerProvider* this_arg_conv = (LDKSignerProvider*)this_arg_ptr;
8453 LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_arg);
8454 int64_t ret_ref = 0;
8455 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8456 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8460 typedef struct LDKFeeEstimator_JCalls {
8461 atomic_size_t refcnt;
8464 jmethodID get_est_sat_per_1000_weight_meth;
8465 } LDKFeeEstimator_JCalls;
8466 static void LDKFeeEstimator_JCalls_free(void* this_arg) {
8467 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
8468 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8470 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8471 if (get_jenv_res == JNI_EDETACHED) {
8472 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8474 DO_ASSERT(get_jenv_res == JNI_OK);
8476 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
8477 if (get_jenv_res == JNI_EDETACHED) {
8478 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8483 uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
8484 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
8486 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8487 if (get_jenv_res == JNI_EDETACHED) {
8488 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8490 DO_ASSERT(get_jenv_res == JNI_OK);
8492 jclass confirmation_target_conv = LDKConfirmationTarget_to_java(env, confirmation_target);
8493 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8495 int32_t ret = (*env)->CallIntMethod(env, obj, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv);
8496 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8497 (*env)->ExceptionDescribe(env);
8498 (*env)->FatalError(env, "A call to get_est_sat_per_1000_weight in LDKFeeEstimator from rust threw an exception.");
8500 if (get_jenv_res == JNI_EDETACHED) {
8501 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8505 static void LDKFeeEstimator_JCalls_cloned(LDKFeeEstimator* new_obj) {
8506 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) new_obj->this_arg;
8507 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8509 static inline LDKFeeEstimator LDKFeeEstimator_init (JNIEnv *env, jclass clz, jobject o) {
8510 jclass c = (*env)->GetObjectClass(env, o);
8512 LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
8513 atomic_init(&calls->refcnt, 1);
8514 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
8515 calls->o = (*env)->NewWeakGlobalRef(env, o);
8516 calls->get_est_sat_per_1000_weight_meth = (*env)->GetMethodID(env, c, "get_est_sat_per_1000_weight", "(Lorg/ldk/enums/ConfirmationTarget;)I");
8517 CHECK(calls->get_est_sat_per_1000_weight_meth != NULL);
8519 LDKFeeEstimator ret = {
8520 .this_arg = (void*) calls,
8521 .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_LDKFeeEstimator_jcall,
8522 .free = LDKFeeEstimator_JCalls_free,
8526 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new(JNIEnv *env, jclass clz, jobject o) {
8527 LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator");
8528 *res_ptr = LDKFeeEstimator_init(env, clz, o);
8529 return tag_ptr(res_ptr, true);
8531 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) {
8532 void* this_arg_ptr = untag_ptr(this_arg);
8533 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8534 LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg_ptr;
8535 LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_java(env, confirmation_target);
8536 int32_t ret_conv = (this_arg_conv->get_est_sat_per_1000_weight)(this_arg_conv->this_arg, confirmation_target_conv);
8540 typedef struct LDKRouter_JCalls {
8541 atomic_size_t refcnt;
8544 jmethodID find_route_meth;
8545 jmethodID find_route_with_id_meth;
8547 static void LDKRouter_JCalls_free(void* this_arg) {
8548 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
8549 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8551 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8552 if (get_jenv_res == JNI_EDETACHED) {
8553 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8555 DO_ASSERT(get_jenv_res == JNI_OK);
8557 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
8558 if (get_jenv_res == JNI_EDETACHED) {
8559 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8564 LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, LDKCVec_ChannelDetailsZ * first_hops, const LDKInFlightHtlcs * inflight_htlcs) {
8565 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
8567 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8568 if (get_jenv_res == JNI_EDETACHED) {
8569 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8571 DO_ASSERT(get_jenv_res == JNI_OK);
8573 int8_tArray payer_arr = (*env)->NewByteArray(env, 33);
8574 (*env)->SetByteArrayRegion(env, payer_arr, 0, 33, payer.compressed_form);
8575 LDKRouteParameters route_params_var = *route_params;
8576 int64_t route_params_ref = 0;
8577 route_params_var = RouteParameters_clone(&route_params_var);
8578 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var);
8579 route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned);
8580 LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
8581 int64_tArray first_hops_arr = NULL;
8582 if (first_hops != NULL) {
8583 LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr;
8584 first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen);
8585 int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL);
8586 for (size_t q = 0; q < first_hops_var.datalen; q++) {
8587 LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q];
8588 int64_t first_hops_conv_16_ref = 0;
8589 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var);
8590 first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned);
8591 first_hops_arr_ptr[q] = first_hops_conv_16_ref;
8593 (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0);
8595 LDKInFlightHtlcs inflight_htlcs_var = *inflight_htlcs;
8596 int64_t inflight_htlcs_ref = 0;
8597 inflight_htlcs_var = InFlightHtlcs_clone(&inflight_htlcs_var);
8598 CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var);
8599 inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned);
8600 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8602 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_meth, payer_arr, route_params_ref, first_hops_arr, inflight_htlcs_ref);
8603 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8604 (*env)->ExceptionDescribe(env);
8605 (*env)->FatalError(env, "A call to find_route in LDKRouter from rust threw an exception.");
8607 void* ret_ptr = untag_ptr(ret);
8608 CHECK_ACCESS(ret_ptr);
8609 LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
8610 FREE(untag_ptr(ret));
8611 if (get_jenv_res == JNI_EDETACHED) {
8612 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8616 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) {
8617 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
8619 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8620 if (get_jenv_res == JNI_EDETACHED) {
8621 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8623 DO_ASSERT(get_jenv_res == JNI_OK);
8625 int8_tArray payer_arr = (*env)->NewByteArray(env, 33);
8626 (*env)->SetByteArrayRegion(env, payer_arr, 0, 33, payer.compressed_form);
8627 LDKRouteParameters route_params_var = *route_params;
8628 int64_t route_params_ref = 0;
8629 route_params_var = RouteParameters_clone(&route_params_var);
8630 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var);
8631 route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned);
8632 LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
8633 int64_tArray first_hops_arr = NULL;
8634 if (first_hops != NULL) {
8635 LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr;
8636 first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen);
8637 int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL);
8638 for (size_t q = 0; q < first_hops_var.datalen; q++) {
8639 LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q];
8640 int64_t first_hops_conv_16_ref = 0;
8641 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var);
8642 first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned);
8643 first_hops_arr_ptr[q] = first_hops_conv_16_ref;
8645 (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0);
8647 LDKInFlightHtlcs inflight_htlcs_var = *inflight_htlcs;
8648 int64_t inflight_htlcs_ref = 0;
8649 inflight_htlcs_var = InFlightHtlcs_clone(&inflight_htlcs_var);
8650 CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var);
8651 inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned);
8652 int8_tArray _payment_hash_arr = (*env)->NewByteArray(env, 32);
8653 (*env)->SetByteArrayRegion(env, _payment_hash_arr, 0, 32, _payment_hash.data);
8654 int8_tArray _payment_id_arr = (*env)->NewByteArray(env, 32);
8655 (*env)->SetByteArrayRegion(env, _payment_id_arr, 0, 32, _payment_id.data);
8656 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
8658 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);
8659 if (UNLIKELY((*env)->ExceptionCheck(env))) {
8660 (*env)->ExceptionDescribe(env);
8661 (*env)->FatalError(env, "A call to find_route_with_id in LDKRouter from rust threw an exception.");
8663 void* ret_ptr = untag_ptr(ret);
8664 CHECK_ACCESS(ret_ptr);
8665 LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
8666 FREE(untag_ptr(ret));
8667 if (get_jenv_res == JNI_EDETACHED) {
8668 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8672 static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) {
8673 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg;
8674 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8676 static inline LDKRouter LDKRouter_init (JNIEnv *env, jclass clz, jobject o) {
8677 jclass c = (*env)->GetObjectClass(env, o);
8679 LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls");
8680 atomic_init(&calls->refcnt, 1);
8681 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
8682 calls->o = (*env)->NewWeakGlobalRef(env, o);
8683 calls->find_route_meth = (*env)->GetMethodID(env, c, "find_route", "([BJ[JJ)J");
8684 CHECK(calls->find_route_meth != NULL);
8685 calls->find_route_with_id_meth = (*env)->GetMethodID(env, c, "find_route_with_id", "([BJ[JJ[B[B)J");
8686 CHECK(calls->find_route_with_id_meth != NULL);
8689 .this_arg = (void*) calls,
8690 .find_route = find_route_LDKRouter_jcall,
8691 .find_route_with_id = find_route_with_id_LDKRouter_jcall,
8692 .free = LDKRouter_JCalls_free,
8696 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRouter_1new(JNIEnv *env, jclass clz, jobject o) {
8697 LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter");
8698 *res_ptr = LDKRouter_init(env, clz, o);
8699 return tag_ptr(res_ptr, true);
8701 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) {
8702 void* this_arg_ptr = untag_ptr(this_arg);
8703 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8704 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
8705 LDKPublicKey payer_ref;
8706 CHECK((*env)->GetArrayLength(env, payer) == 33);
8707 (*env)->GetByteArrayRegion(env, payer, 0, 33, payer_ref.compressed_form);
8708 LDKRouteParameters route_params_conv;
8709 route_params_conv.inner = untag_ptr(route_params);
8710 route_params_conv.is_owned = ptr_is_owned(route_params);
8711 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
8712 route_params_conv.is_owned = false;
8713 LDKCVec_ChannelDetailsZ first_hops_constr;
8714 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
8715 if (first_hops != NULL) {
8716 first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops);
8717 if (first_hops_constr.datalen > 0)
8718 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
8720 first_hops_constr.data = NULL;
8721 int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL);
8722 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
8723 int64_t first_hops_conv_16 = first_hops_vals[q];
8724 LDKChannelDetails first_hops_conv_16_conv;
8725 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
8726 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
8727 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
8728 first_hops_conv_16_conv.is_owned = false;
8729 first_hops_constr.data[q] = first_hops_conv_16_conv;
8731 (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
8732 first_hops_ptr = &first_hops_constr;
8734 LDKInFlightHtlcs inflight_htlcs_conv;
8735 inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs);
8736 inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs);
8737 CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv);
8738 inflight_htlcs_conv.is_owned = false;
8739 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
8740 *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, &route_params_conv, first_hops_ptr, &inflight_htlcs_conv);
8741 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
8742 return tag_ptr(ret_conv, true);
8745 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) {
8746 void* this_arg_ptr = untag_ptr(this_arg);
8747 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8748 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
8749 LDKPublicKey payer_ref;
8750 CHECK((*env)->GetArrayLength(env, payer) == 33);
8751 (*env)->GetByteArrayRegion(env, payer, 0, 33, payer_ref.compressed_form);
8752 LDKRouteParameters route_params_conv;
8753 route_params_conv.inner = untag_ptr(route_params);
8754 route_params_conv.is_owned = ptr_is_owned(route_params);
8755 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
8756 route_params_conv.is_owned = false;
8757 LDKCVec_ChannelDetailsZ first_hops_constr;
8758 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
8759 if (first_hops != NULL) {
8760 first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops);
8761 if (first_hops_constr.datalen > 0)
8762 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
8764 first_hops_constr.data = NULL;
8765 int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL);
8766 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
8767 int64_t first_hops_conv_16 = first_hops_vals[q];
8768 LDKChannelDetails first_hops_conv_16_conv;
8769 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
8770 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
8771 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
8772 first_hops_conv_16_conv.is_owned = false;
8773 first_hops_constr.data[q] = first_hops_conv_16_conv;
8775 (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
8776 first_hops_ptr = &first_hops_constr;
8778 LDKInFlightHtlcs inflight_htlcs_conv;
8779 inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs);
8780 inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs);
8781 CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv);
8782 inflight_htlcs_conv.is_owned = false;
8783 LDKThirtyTwoBytes _payment_hash_ref;
8784 CHECK((*env)->GetArrayLength(env, _payment_hash) == 32);
8785 (*env)->GetByteArrayRegion(env, _payment_hash, 0, 32, _payment_hash_ref.data);
8786 LDKThirtyTwoBytes _payment_id_ref;
8787 CHECK((*env)->GetArrayLength(env, _payment_id) == 32);
8788 (*env)->GetByteArrayRegion(env, _payment_id, 0, 32, _payment_id_ref.data);
8789 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
8790 *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);
8791 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
8792 return tag_ptr(ret_conv, true);
8795 static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){
8796 return ThirtyTwoBytes_clone(&owner->a);
8798 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
8799 LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)untag_ptr(owner);
8800 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
8801 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_BlockHashChannelManagerZ_get_a(owner_conv).data);
8805 static inline struct LDKChannelManager C2Tuple_BlockHashChannelManagerZ_get_b(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){
8806 LDKChannelManager ret = owner->b;
8807 ret.is_owned = false;
8810 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
8811 LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)untag_ptr(owner);
8812 LDKChannelManager ret_var = C2Tuple_BlockHashChannelManagerZ_get_b(owner_conv);
8813 int64_t ret_ref = 0;
8814 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8815 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8819 static inline struct LDKC2Tuple_BlockHashChannelManagerZ *CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
8820 CHECK(owner->result_ok);
8821 return &*owner->contents.result;
8823 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8824 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
8825 int64_t ret_ret = tag_ptr(CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(owner_conv), false);
8829 static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
8830 CHECK(!owner->result_ok);
8831 return DecodeError_clone(&*owner->contents.err);
8833 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8834 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
8835 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
8836 *ret_copy = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner_conv);
8837 int64_t ret_ref = tag_ptr(ret_copy, true);
8841 static inline struct LDKChannelConfig CResult_ChannelConfigDecodeErrorZ_get_ok(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
8842 LDKChannelConfig ret = *owner->contents.result;
8843 ret.is_owned = false;
8846 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8847 LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
8848 LDKChannelConfig ret_var = CResult_ChannelConfigDecodeErrorZ_get_ok(owner_conv);
8849 int64_t ret_ref = 0;
8850 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8851 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8855 static inline struct LDKDecodeError CResult_ChannelConfigDecodeErrorZ_get_err(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
8856 CHECK(!owner->result_ok);
8857 return DecodeError_clone(&*owner->contents.err);
8859 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8860 LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
8861 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
8862 *ret_copy = CResult_ChannelConfigDecodeErrorZ_get_err(owner_conv);
8863 int64_t ret_ref = tag_ptr(ret_copy, true);
8867 static jclass LDKCOption_APIErrorZ_Some_class = NULL;
8868 static jmethodID LDKCOption_APIErrorZ_Some_meth = NULL;
8869 static jclass LDKCOption_APIErrorZ_None_class = NULL;
8870 static jmethodID LDKCOption_APIErrorZ_None_meth = NULL;
8871 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1APIErrorZ_init (JNIEnv *env, jclass clz) {
8872 LDKCOption_APIErrorZ_Some_class =
8873 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_APIErrorZ$Some"));
8874 CHECK(LDKCOption_APIErrorZ_Some_class != NULL);
8875 LDKCOption_APIErrorZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_APIErrorZ_Some_class, "<init>", "(J)V");
8876 CHECK(LDKCOption_APIErrorZ_Some_meth != NULL);
8877 LDKCOption_APIErrorZ_None_class =
8878 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_APIErrorZ$None"));
8879 CHECK(LDKCOption_APIErrorZ_None_class != NULL);
8880 LDKCOption_APIErrorZ_None_meth = (*env)->GetMethodID(env, LDKCOption_APIErrorZ_None_class, "<init>", "()V");
8881 CHECK(LDKCOption_APIErrorZ_None_meth != NULL);
8883 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1APIErrorZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
8884 LDKCOption_APIErrorZ *obj = (LDKCOption_APIErrorZ*)untag_ptr(ptr);
8886 case LDKCOption_APIErrorZ_Some: {
8887 int64_t some_ref = tag_ptr(&obj->some, false);
8888 return (*env)->NewObject(env, LDKCOption_APIErrorZ_Some_class, LDKCOption_APIErrorZ_Some_meth, some_ref);
8890 case LDKCOption_APIErrorZ_None: {
8891 return (*env)->NewObject(env, LDKCOption_APIErrorZ_None_class, LDKCOption_APIErrorZ_None_meth);
8896 static inline struct LDKCOption_APIErrorZ CResult_COption_APIErrorZDecodeErrorZ_get_ok(LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR owner){
8897 CHECK(owner->result_ok);
8898 return COption_APIErrorZ_clone(&*owner->contents.result);
8900 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1APIErrorZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8901 LDKCResult_COption_APIErrorZDecodeErrorZ* owner_conv = (LDKCResult_COption_APIErrorZDecodeErrorZ*)untag_ptr(owner);
8902 LDKCOption_APIErrorZ *ret_copy = MALLOC(sizeof(LDKCOption_APIErrorZ), "LDKCOption_APIErrorZ");
8903 *ret_copy = CResult_COption_APIErrorZDecodeErrorZ_get_ok(owner_conv);
8904 int64_t ret_ref = tag_ptr(ret_copy, true);
8908 static inline struct LDKDecodeError CResult_COption_APIErrorZDecodeErrorZ_get_err(LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR owner){
8909 CHECK(!owner->result_ok);
8910 return DecodeError_clone(&*owner->contents.err);
8912 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1APIErrorZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8913 LDKCResult_COption_APIErrorZDecodeErrorZ* owner_conv = (LDKCResult_COption_APIErrorZDecodeErrorZ*)untag_ptr(owner);
8914 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
8915 *ret_copy = CResult_COption_APIErrorZDecodeErrorZ_get_err(owner_conv);
8916 int64_t ret_ref = tag_ptr(ret_copy, true);
8920 static inline struct LDKUntrustedString CResult_UntrustedStringDecodeErrorZ_get_ok(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){
8921 LDKUntrustedString ret = *owner->contents.result;
8922 ret.is_owned = false;
8925 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8926 LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner);
8927 LDKUntrustedString ret_var = CResult_UntrustedStringDecodeErrorZ_get_ok(owner_conv);
8928 int64_t ret_ref = 0;
8929 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8930 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8934 static inline struct LDKDecodeError CResult_UntrustedStringDecodeErrorZ_get_err(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner){
8935 CHECK(!owner->result_ok);
8936 return DecodeError_clone(&*owner->contents.err);
8938 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8939 LDKCResult_UntrustedStringDecodeErrorZ* owner_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(owner);
8940 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
8941 *ret_copy = CResult_UntrustedStringDecodeErrorZ_get_err(owner_conv);
8942 int64_t ret_ref = tag_ptr(ret_copy, true);
8946 static inline struct LDKOutPoint CResult_OutPointDecodeErrorZ_get_ok(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
8947 LDKOutPoint ret = *owner->contents.result;
8948 ret.is_owned = false;
8951 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
8952 LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
8953 LDKOutPoint ret_var = CResult_OutPointDecodeErrorZ_get_ok(owner_conv);
8954 int64_t ret_ref = 0;
8955 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
8956 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
8960 static inline struct LDKDecodeError CResult_OutPointDecodeErrorZ_get_err(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
8961 CHECK(!owner->result_ok);
8962 return DecodeError_clone(&*owner->contents.err);
8964 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
8965 LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
8966 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
8967 *ret_copy = CResult_OutPointDecodeErrorZ_get_err(owner_conv);
8968 int64_t ret_ref = tag_ptr(ret_copy, true);
8972 typedef struct LDKType_JCalls {
8973 atomic_size_t refcnt;
8976 jmethodID type_id_meth;
8977 jmethodID debug_str_meth;
8978 jmethodID write_meth;
8980 static void LDKType_JCalls_free(void* this_arg) {
8981 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
8982 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8984 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
8985 if (get_jenv_res == JNI_EDETACHED) {
8986 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
8988 DO_ASSERT(get_jenv_res == JNI_OK);
8990 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
8991 if (get_jenv_res == JNI_EDETACHED) {
8992 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
8997 uint16_t type_id_LDKType_jcall(const void* this_arg) {
8998 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
9000 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9001 if (get_jenv_res == JNI_EDETACHED) {
9002 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9004 DO_ASSERT(get_jenv_res == JNI_OK);
9006 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9008 int16_t ret = (*env)->CallShortMethod(env, obj, j_calls->type_id_meth);
9009 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9010 (*env)->ExceptionDescribe(env);
9011 (*env)->FatalError(env, "A call to type_id in LDKType from rust threw an exception.");
9013 if (get_jenv_res == JNI_EDETACHED) {
9014 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9018 LDKStr debug_str_LDKType_jcall(const void* this_arg) {
9019 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
9021 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9022 if (get_jenv_res == JNI_EDETACHED) {
9023 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9025 DO_ASSERT(get_jenv_res == JNI_OK);
9027 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9029 jstring ret = (*env)->CallObjectMethod(env, obj, j_calls->debug_str_meth);
9030 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9031 (*env)->ExceptionDescribe(env);
9032 (*env)->FatalError(env, "A call to debug_str in LDKType from rust threw an exception.");
9034 LDKStr ret_conv = java_to_owned_str(env, ret);
9035 if (get_jenv_res == JNI_EDETACHED) {
9036 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9040 LDKCVec_u8Z write_LDKType_jcall(const void* this_arg) {
9041 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
9043 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9044 if (get_jenv_res == JNI_EDETACHED) {
9045 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9047 DO_ASSERT(get_jenv_res == JNI_OK);
9049 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9051 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
9052 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9053 (*env)->ExceptionDescribe(env);
9054 (*env)->FatalError(env, "A call to write in LDKType from rust threw an exception.");
9056 LDKCVec_u8Z ret_ref;
9057 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
9058 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
9059 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
9060 if (get_jenv_res == JNI_EDETACHED) {
9061 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9065 static void LDKType_JCalls_cloned(LDKType* new_obj) {
9066 LDKType_JCalls *j_calls = (LDKType_JCalls*) new_obj->this_arg;
9067 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9069 static inline LDKType LDKType_init (JNIEnv *env, jclass clz, jobject o) {
9070 jclass c = (*env)->GetObjectClass(env, o);
9072 LDKType_JCalls *calls = MALLOC(sizeof(LDKType_JCalls), "LDKType_JCalls");
9073 atomic_init(&calls->refcnt, 1);
9074 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
9075 calls->o = (*env)->NewWeakGlobalRef(env, o);
9076 calls->type_id_meth = (*env)->GetMethodID(env, c, "type_id", "()S");
9077 CHECK(calls->type_id_meth != NULL);
9078 calls->debug_str_meth = (*env)->GetMethodID(env, c, "debug_str", "()Ljava/lang/String;");
9079 CHECK(calls->debug_str_meth != NULL);
9080 calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
9081 CHECK(calls->write_meth != NULL);
9084 .this_arg = (void*) calls,
9085 .type_id = type_id_LDKType_jcall,
9086 .debug_str = debug_str_LDKType_jcall,
9087 .write = write_LDKType_jcall,
9088 .cloned = LDKType_JCalls_cloned,
9089 .free = LDKType_JCalls_free,
9093 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKType_1new(JNIEnv *env, jclass clz, jobject o) {
9094 LDKType *res_ptr = MALLOC(sizeof(LDKType), "LDKType");
9095 *res_ptr = LDKType_init(env, clz, o);
9096 return tag_ptr(res_ptr, true);
9098 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Type_1type_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
9099 void* this_arg_ptr = untag_ptr(this_arg);
9100 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9101 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
9102 int16_t ret_conv = (this_arg_conv->type_id)(this_arg_conv->this_arg);
9106 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Type_1debug_1str(JNIEnv *env, jclass clz, int64_t this_arg) {
9107 void* this_arg_ptr = untag_ptr(this_arg);
9108 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9109 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
9110 LDKStr ret_str = (this_arg_conv->debug_str)(this_arg_conv->this_arg);
9111 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
9116 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Type_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
9117 void* this_arg_ptr = untag_ptr(this_arg);
9118 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9119 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
9120 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
9121 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
9122 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
9123 CVec_u8Z_free(ret_var);
9127 static jclass LDKCOption_TypeZ_Some_class = NULL;
9128 static jmethodID LDKCOption_TypeZ_Some_meth = NULL;
9129 static jclass LDKCOption_TypeZ_None_class = NULL;
9130 static jmethodID LDKCOption_TypeZ_None_meth = NULL;
9131 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1TypeZ_init (JNIEnv *env, jclass clz) {
9132 LDKCOption_TypeZ_Some_class =
9133 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_TypeZ$Some"));
9134 CHECK(LDKCOption_TypeZ_Some_class != NULL);
9135 LDKCOption_TypeZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_TypeZ_Some_class, "<init>", "(J)V");
9136 CHECK(LDKCOption_TypeZ_Some_meth != NULL);
9137 LDKCOption_TypeZ_None_class =
9138 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_TypeZ$None"));
9139 CHECK(LDKCOption_TypeZ_None_class != NULL);
9140 LDKCOption_TypeZ_None_meth = (*env)->GetMethodID(env, LDKCOption_TypeZ_None_class, "<init>", "()V");
9141 CHECK(LDKCOption_TypeZ_None_meth != NULL);
9143 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1TypeZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
9144 LDKCOption_TypeZ *obj = (LDKCOption_TypeZ*)untag_ptr(ptr);
9146 case LDKCOption_TypeZ_Some: {
9147 LDKType* some_ret = MALLOC(sizeof(LDKType), "LDKType");
9148 *some_ret = Type_clone(&obj->some);
9149 return (*env)->NewObject(env, LDKCOption_TypeZ_Some_class, LDKCOption_TypeZ_Some_meth, tag_ptr(some_ret, true));
9151 case LDKCOption_TypeZ_None: {
9152 return (*env)->NewObject(env, LDKCOption_TypeZ_None_class, LDKCOption_TypeZ_None_meth);
9157 static inline struct LDKCOption_TypeZ CResult_COption_TypeZDecodeErrorZ_get_ok(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
9158 CHECK(owner->result_ok);
9159 return COption_TypeZ_clone(&*owner->contents.result);
9161 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9162 LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
9163 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
9164 *ret_copy = CResult_COption_TypeZDecodeErrorZ_get_ok(owner_conv);
9165 int64_t ret_ref = tag_ptr(ret_copy, true);
9169 static inline struct LDKDecodeError CResult_COption_TypeZDecodeErrorZ_get_err(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
9170 CHECK(!owner->result_ok);
9171 return DecodeError_clone(&*owner->contents.err);
9173 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9174 LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
9175 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9176 *ret_copy = CResult_COption_TypeZDecodeErrorZ_get_err(owner_conv);
9177 int64_t ret_ref = tag_ptr(ret_copy, true);
9181 static jclass LDKPaymentError_Invoice_class = NULL;
9182 static jmethodID LDKPaymentError_Invoice_meth = NULL;
9183 static jclass LDKPaymentError_Sending_class = NULL;
9184 static jmethodID LDKPaymentError_Sending_meth = NULL;
9185 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentError_init (JNIEnv *env, jclass clz) {
9186 LDKPaymentError_Invoice_class =
9187 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentError$Invoice"));
9188 CHECK(LDKPaymentError_Invoice_class != NULL);
9189 LDKPaymentError_Invoice_meth = (*env)->GetMethodID(env, LDKPaymentError_Invoice_class, "<init>", "(Ljava/lang/String;)V");
9190 CHECK(LDKPaymentError_Invoice_meth != NULL);
9191 LDKPaymentError_Sending_class =
9192 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentError$Sending"));
9193 CHECK(LDKPaymentError_Sending_class != NULL);
9194 LDKPaymentError_Sending_meth = (*env)->GetMethodID(env, LDKPaymentError_Sending_class, "<init>", "(Lorg/ldk/enums/RetryableSendFailure;)V");
9195 CHECK(LDKPaymentError_Sending_meth != NULL);
9197 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
9198 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
9200 case LDKPaymentError_Invoice: {
9201 LDKStr invoice_str = obj->invoice;
9202 jstring invoice_conv = str_ref_to_java(env, invoice_str.chars, invoice_str.len);
9203 return (*env)->NewObject(env, LDKPaymentError_Invoice_class, LDKPaymentError_Invoice_meth, invoice_conv);
9205 case LDKPaymentError_Sending: {
9206 jclass sending_conv = LDKRetryableSendFailure_to_java(env, obj->sending);
9207 return (*env)->NewObject(env, LDKPaymentError_Sending_class, LDKPaymentError_Sending_meth, sending_conv);
9212 static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentErrorZ_get_ok(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner){
9213 CHECK(owner->result_ok);
9214 return ThirtyTwoBytes_clone(&*owner->contents.result);
9216 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9217 LDKCResult_PaymentIdPaymentErrorZ* owner_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(owner);
9218 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
9219 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentIdPaymentErrorZ_get_ok(owner_conv).data);
9223 static inline struct LDKPaymentError CResult_PaymentIdPaymentErrorZ_get_err(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner){
9224 CHECK(!owner->result_ok);
9225 return PaymentError_clone(&*owner->contents.err);
9227 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9228 LDKCResult_PaymentIdPaymentErrorZ* owner_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(owner);
9229 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
9230 *ret_copy = CResult_PaymentIdPaymentErrorZ_get_err(owner_conv);
9231 int64_t ret_ref = tag_ptr(ret_copy, true);
9235 static inline void CResult_NonePaymentErrorZ_get_ok(LDKCResult_NonePaymentErrorZ *NONNULL_PTR owner){
9236 CHECK(owner->result_ok);
9237 return *owner->contents.result;
9239 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9240 LDKCResult_NonePaymentErrorZ* owner_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(owner);
9241 CResult_NonePaymentErrorZ_get_ok(owner_conv);
9244 static inline struct LDKPaymentError CResult_NonePaymentErrorZ_get_err(LDKCResult_NonePaymentErrorZ *NONNULL_PTR owner){
9245 CHECK(!owner->result_ok);
9246 return PaymentError_clone(&*owner->contents.err);
9248 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9249 LDKCResult_NonePaymentErrorZ* owner_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(owner);
9250 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
9251 *ret_copy = CResult_NonePaymentErrorZ_get_err(owner_conv);
9252 int64_t ret_ref = tag_ptr(ret_copy, true);
9256 static inline struct LDKStr CResult_StringErrorZ_get_ok(LDKCResult_StringErrorZ *NONNULL_PTR owner){
9257 CHECK(owner->result_ok);
9258 return *owner->contents.result;
9260 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9261 LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
9262 LDKStr ret_str = CResult_StringErrorZ_get_ok(owner_conv);
9263 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
9267 static inline enum LDKSecp256k1Error CResult_StringErrorZ_get_err(LDKCResult_StringErrorZ *NONNULL_PTR owner){
9268 CHECK(!owner->result_ok);
9269 return *owner->contents.err;
9271 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9272 LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
9273 jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_StringErrorZ_get_err(owner_conv));
9277 static inline struct LDKChannelMonitorUpdate CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
9278 LDKChannelMonitorUpdate ret = *owner->contents.result;
9279 ret.is_owned = false;
9282 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9283 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
9284 LDKChannelMonitorUpdate ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(owner_conv);
9285 int64_t ret_ref = 0;
9286 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9287 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9291 static inline struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
9292 CHECK(!owner->result_ok);
9293 return DecodeError_clone(&*owner->contents.err);
9295 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9296 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
9297 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9298 *ret_copy = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv);
9299 int64_t ret_ref = tag_ptr(ret_copy, true);
9303 static jclass LDKCOption_MonitorEventZ_Some_class = NULL;
9304 static jmethodID LDKCOption_MonitorEventZ_Some_meth = NULL;
9305 static jclass LDKCOption_MonitorEventZ_None_class = NULL;
9306 static jmethodID LDKCOption_MonitorEventZ_None_meth = NULL;
9307 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1MonitorEventZ_init (JNIEnv *env, jclass clz) {
9308 LDKCOption_MonitorEventZ_Some_class =
9309 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$Some"));
9310 CHECK(LDKCOption_MonitorEventZ_Some_class != NULL);
9311 LDKCOption_MonitorEventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_Some_class, "<init>", "(J)V");
9312 CHECK(LDKCOption_MonitorEventZ_Some_meth != NULL);
9313 LDKCOption_MonitorEventZ_None_class =
9314 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$None"));
9315 CHECK(LDKCOption_MonitorEventZ_None_class != NULL);
9316 LDKCOption_MonitorEventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_None_class, "<init>", "()V");
9317 CHECK(LDKCOption_MonitorEventZ_None_meth != NULL);
9319 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1MonitorEventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
9320 LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr);
9322 case LDKCOption_MonitorEventZ_Some: {
9323 int64_t some_ref = tag_ptr(&obj->some, false);
9324 return (*env)->NewObject(env, LDKCOption_MonitorEventZ_Some_class, LDKCOption_MonitorEventZ_Some_meth, some_ref);
9326 case LDKCOption_MonitorEventZ_None: {
9327 return (*env)->NewObject(env, LDKCOption_MonitorEventZ_None_class, LDKCOption_MonitorEventZ_None_meth);
9332 static inline struct LDKCOption_MonitorEventZ CResult_COption_MonitorEventZDecodeErrorZ_get_ok(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
9333 CHECK(owner->result_ok);
9334 return COption_MonitorEventZ_clone(&*owner->contents.result);
9336 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9337 LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
9338 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
9339 *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_ok(owner_conv);
9340 int64_t ret_ref = tag_ptr(ret_copy, true);
9344 static inline struct LDKDecodeError CResult_COption_MonitorEventZDecodeErrorZ_get_err(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
9345 CHECK(!owner->result_ok);
9346 return DecodeError_clone(&*owner->contents.err);
9348 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9349 LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
9350 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9351 *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv);
9352 int64_t ret_ref = tag_ptr(ret_copy, true);
9356 static inline struct LDKHTLCUpdate CResult_HTLCUpdateDecodeErrorZ_get_ok(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
9357 LDKHTLCUpdate ret = *owner->contents.result;
9358 ret.is_owned = false;
9361 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9362 LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
9363 LDKHTLCUpdate ret_var = CResult_HTLCUpdateDecodeErrorZ_get_ok(owner_conv);
9364 int64_t ret_ref = 0;
9365 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9366 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9370 static inline struct LDKDecodeError CResult_HTLCUpdateDecodeErrorZ_get_err(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
9371 CHECK(!owner->result_ok);
9372 return DecodeError_clone(&*owner->contents.err);
9374 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9375 LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
9376 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9377 *ret_copy = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv);
9378 int64_t ret_ref = tag_ptr(ret_copy, true);
9382 static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
9383 LDKOutPoint ret = owner->a;
9384 ret.is_owned = false;
9387 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
9388 LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
9389 LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(owner_conv);
9390 int64_t ret_ref = 0;
9391 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9392 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9396 static inline struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
9397 return CVec_u8Z_clone(&owner->b);
9399 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
9400 LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
9401 LDKCVec_u8Z ret_var = C2Tuple_OutPointScriptZ_get_b(owner_conv);
9402 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
9403 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
9404 CVec_u8Z_free(ret_var);
9408 static inline uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
9411 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
9412 LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
9413 int32_t ret_conv = C2Tuple_u32ScriptZ_get_a(owner_conv);
9417 static inline struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
9418 return CVec_u8Z_clone(&owner->b);
9420 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
9421 LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
9422 LDKCVec_u8Z ret_var = C2Tuple_u32ScriptZ_get_b(owner_conv);
9423 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
9424 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
9425 CVec_u8Z_free(ret_var);
9429 static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) {
9430 LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen };
9431 for (size_t i = 0; i < ret.datalen; i++) {
9432 ret.data[i] = C2Tuple_u32ScriptZ_clone(&orig->data[i]);
9436 static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){
9437 return ThirtyTwoBytes_clone(&owner->a);
9439 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
9440 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner);
9441 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
9442 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(owner_conv).data);
9446 static inline struct LDKCVec_C2Tuple_u32ScriptZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){
9447 return CVec_C2Tuple_u32ScriptZZ_clone(&owner->b);
9449 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
9450 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner);
9451 LDKCVec_C2Tuple_u32ScriptZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(owner_conv);
9452 int64_tArray ret_arr = NULL;
9453 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
9454 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
9455 for (size_t v = 0; v < ret_var.datalen; v++) {
9456 LDKC2Tuple_u32ScriptZ* ret_conv_21_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
9457 *ret_conv_21_conv = ret_var.data[v];
9458 ret_arr_ptr[v] = tag_ptr(ret_conv_21_conv, true);
9460 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
9465 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *orig) {
9466 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 };
9467 for (size_t i = 0; i < ret.datalen; i++) {
9468 ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(&orig->data[i]);
9472 static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) {
9473 LDKCVec_EventZ ret = { .data = MALLOC(sizeof(LDKEvent) * orig->datalen, "LDKCVec_EventZ clone bytes"), .datalen = orig->datalen };
9474 for (size_t i = 0; i < ret.datalen; i++) {
9475 ret.data[i] = Event_clone(&orig->data[i]);
9479 static inline uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){
9482 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
9483 LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner);
9484 int32_t ret_conv = C2Tuple_u32TxOutZ_get_a(owner_conv);
9488 static inline struct LDKTxOut C2Tuple_u32TxOutZ_get_b(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){
9489 return TxOut_clone(&owner->b);
9491 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
9492 LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner);
9493 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
9494 *ret_ref = C2Tuple_u32TxOutZ_get_b(owner_conv);
9495 return tag_ptr(ret_ref, true);
9498 static inline LDKCVec_C2Tuple_u32TxOutZZ CVec_C2Tuple_u32TxOutZZ_clone(const LDKCVec_C2Tuple_u32TxOutZZ *orig) {
9499 LDKCVec_C2Tuple_u32TxOutZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * orig->datalen, "LDKCVec_C2Tuple_u32TxOutZZ clone bytes"), .datalen = orig->datalen };
9500 for (size_t i = 0; i < ret.datalen; i++) {
9501 ret.data[i] = C2Tuple_u32TxOutZ_clone(&orig->data[i]);
9505 static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner){
9506 return ThirtyTwoBytes_clone(&owner->a);
9508 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
9509 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(owner);
9510 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
9511 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(owner_conv).data);
9515 static inline struct LDKCVec_C2Tuple_u32TxOutZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner){
9516 return CVec_C2Tuple_u32TxOutZZ_clone(&owner->b);
9518 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
9519 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(owner);
9520 LDKCVec_C2Tuple_u32TxOutZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(owner_conv);
9521 int64_tArray ret_arr = NULL;
9522 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
9523 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
9524 for (size_t u = 0; u < ret_var.datalen; u++) {
9525 LDKC2Tuple_u32TxOutZ* ret_conv_20_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
9526 *ret_conv_20_conv = ret_var.data[u];
9527 ret_arr_ptr[u] = tag_ptr(ret_conv_20_conv, true);
9529 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
9534 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *orig) {
9535 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 };
9536 for (size_t i = 0; i < ret.datalen; i++) {
9537 ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(&orig->data[i]);
9541 static jclass LDKBalance_ClaimableOnChannelClose_class = NULL;
9542 static jmethodID LDKBalance_ClaimableOnChannelClose_meth = NULL;
9543 static jclass LDKBalance_ClaimableAwaitingConfirmations_class = NULL;
9544 static jmethodID LDKBalance_ClaimableAwaitingConfirmations_meth = NULL;
9545 static jclass LDKBalance_ContentiousClaimable_class = NULL;
9546 static jmethodID LDKBalance_ContentiousClaimable_meth = NULL;
9547 static jclass LDKBalance_MaybeTimeoutClaimableHTLC_class = NULL;
9548 static jmethodID LDKBalance_MaybeTimeoutClaimableHTLC_meth = NULL;
9549 static jclass LDKBalance_MaybePreimageClaimableHTLC_class = NULL;
9550 static jmethodID LDKBalance_MaybePreimageClaimableHTLC_meth = NULL;
9551 static jclass LDKBalance_CounterpartyRevokedOutputClaimable_class = NULL;
9552 static jmethodID LDKBalance_CounterpartyRevokedOutputClaimable_meth = NULL;
9553 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBalance_init (JNIEnv *env, jclass clz) {
9554 LDKBalance_ClaimableOnChannelClose_class =
9555 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ClaimableOnChannelClose"));
9556 CHECK(LDKBalance_ClaimableOnChannelClose_class != NULL);
9557 LDKBalance_ClaimableOnChannelClose_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableOnChannelClose_class, "<init>", "(J)V");
9558 CHECK(LDKBalance_ClaimableOnChannelClose_meth != NULL);
9559 LDKBalance_ClaimableAwaitingConfirmations_class =
9560 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ClaimableAwaitingConfirmations"));
9561 CHECK(LDKBalance_ClaimableAwaitingConfirmations_class != NULL);
9562 LDKBalance_ClaimableAwaitingConfirmations_meth = (*env)->GetMethodID(env, LDKBalance_ClaimableAwaitingConfirmations_class, "<init>", "(JI)V");
9563 CHECK(LDKBalance_ClaimableAwaitingConfirmations_meth != NULL);
9564 LDKBalance_ContentiousClaimable_class =
9565 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$ContentiousClaimable"));
9566 CHECK(LDKBalance_ContentiousClaimable_class != NULL);
9567 LDKBalance_ContentiousClaimable_meth = (*env)->GetMethodID(env, LDKBalance_ContentiousClaimable_class, "<init>", "(JI)V");
9568 CHECK(LDKBalance_ContentiousClaimable_meth != NULL);
9569 LDKBalance_MaybeTimeoutClaimableHTLC_class =
9570 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$MaybeTimeoutClaimableHTLC"));
9571 CHECK(LDKBalance_MaybeTimeoutClaimableHTLC_class != NULL);
9572 LDKBalance_MaybeTimeoutClaimableHTLC_meth = (*env)->GetMethodID(env, LDKBalance_MaybeTimeoutClaimableHTLC_class, "<init>", "(JI)V");
9573 CHECK(LDKBalance_MaybeTimeoutClaimableHTLC_meth != NULL);
9574 LDKBalance_MaybePreimageClaimableHTLC_class =
9575 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$MaybePreimageClaimableHTLC"));
9576 CHECK(LDKBalance_MaybePreimageClaimableHTLC_class != NULL);
9577 LDKBalance_MaybePreimageClaimableHTLC_meth = (*env)->GetMethodID(env, LDKBalance_MaybePreimageClaimableHTLC_class, "<init>", "(JI)V");
9578 CHECK(LDKBalance_MaybePreimageClaimableHTLC_meth != NULL);
9579 LDKBalance_CounterpartyRevokedOutputClaimable_class =
9580 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKBalance$CounterpartyRevokedOutputClaimable"));
9581 CHECK(LDKBalance_CounterpartyRevokedOutputClaimable_class != NULL);
9582 LDKBalance_CounterpartyRevokedOutputClaimable_meth = (*env)->GetMethodID(env, LDKBalance_CounterpartyRevokedOutputClaimable_class, "<init>", "(J)V");
9583 CHECK(LDKBalance_CounterpartyRevokedOutputClaimable_meth != NULL);
9585 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBalance_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
9586 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
9588 case LDKBalance_ClaimableOnChannelClose: {
9589 int64_t claimable_amount_satoshis_conv = obj->claimable_on_channel_close.claimable_amount_satoshis;
9590 return (*env)->NewObject(env, LDKBalance_ClaimableOnChannelClose_class, LDKBalance_ClaimableOnChannelClose_meth, claimable_amount_satoshis_conv);
9592 case LDKBalance_ClaimableAwaitingConfirmations: {
9593 int64_t claimable_amount_satoshis_conv = obj->claimable_awaiting_confirmations.claimable_amount_satoshis;
9594 int32_t confirmation_height_conv = obj->claimable_awaiting_confirmations.confirmation_height;
9595 return (*env)->NewObject(env, LDKBalance_ClaimableAwaitingConfirmations_class, LDKBalance_ClaimableAwaitingConfirmations_meth, claimable_amount_satoshis_conv, confirmation_height_conv);
9597 case LDKBalance_ContentiousClaimable: {
9598 int64_t claimable_amount_satoshis_conv = obj->contentious_claimable.claimable_amount_satoshis;
9599 int32_t timeout_height_conv = obj->contentious_claimable.timeout_height;
9600 return (*env)->NewObject(env, LDKBalance_ContentiousClaimable_class, LDKBalance_ContentiousClaimable_meth, claimable_amount_satoshis_conv, timeout_height_conv);
9602 case LDKBalance_MaybeTimeoutClaimableHTLC: {
9603 int64_t claimable_amount_satoshis_conv = obj->maybe_timeout_claimable_htlc.claimable_amount_satoshis;
9604 int32_t claimable_height_conv = obj->maybe_timeout_claimable_htlc.claimable_height;
9605 return (*env)->NewObject(env, LDKBalance_MaybeTimeoutClaimableHTLC_class, LDKBalance_MaybeTimeoutClaimableHTLC_meth, claimable_amount_satoshis_conv, claimable_height_conv);
9607 case LDKBalance_MaybePreimageClaimableHTLC: {
9608 int64_t claimable_amount_satoshis_conv = obj->maybe_preimage_claimable_htlc.claimable_amount_satoshis;
9609 int32_t expiry_height_conv = obj->maybe_preimage_claimable_htlc.expiry_height;
9610 return (*env)->NewObject(env, LDKBalance_MaybePreimageClaimableHTLC_class, LDKBalance_MaybePreimageClaimableHTLC_meth, claimable_amount_satoshis_conv, expiry_height_conv);
9612 case LDKBalance_CounterpartyRevokedOutputClaimable: {
9613 int64_t claimable_amount_satoshis_conv = obj->counterparty_revoked_output_claimable.claimable_amount_satoshis;
9614 return (*env)->NewObject(env, LDKBalance_CounterpartyRevokedOutputClaimable_class, LDKBalance_CounterpartyRevokedOutputClaimable_meth, claimable_amount_satoshis_conv);
9619 static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) {
9620 LDKCVec_BalanceZ ret = { .data = MALLOC(sizeof(LDKBalance) * orig->datalen, "LDKCVec_BalanceZ clone bytes"), .datalen = orig->datalen };
9621 for (size_t i = 0; i < ret.datalen; i++) {
9622 ret.data[i] = Balance_clone(&orig->data[i]);
9626 static inline struct LDKC2Tuple_BlockHashChannelMonitorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
9627 CHECK(owner->result_ok);
9628 return C2Tuple_BlockHashChannelMonitorZ_clone(&*owner->contents.result);
9630 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9631 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
9632 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
9633 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(owner_conv);
9634 return tag_ptr(ret_conv, true);
9637 static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
9638 CHECK(!owner->result_ok);
9639 return DecodeError_clone(&*owner->contents.err);
9641 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9642 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
9643 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9644 *ret_copy = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner_conv);
9645 int64_t ret_ref = tag_ptr(ret_copy, true);
9649 static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){
9652 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
9653 LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(owner);
9654 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
9655 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, C2Tuple_PublicKeyTypeZ_get_a(owner_conv).compressed_form);
9659 static inline struct LDKType C2Tuple_PublicKeyTypeZ_get_b(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){
9660 return Type_clone(&owner->b);
9662 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
9663 LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(owner);
9664 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
9665 *ret_ret = C2Tuple_PublicKeyTypeZ_get_b(owner_conv);
9666 return tag_ptr(ret_ret, true);
9669 static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone(const LDKCVec_C2Tuple_PublicKeyTypeZZ *orig) {
9670 LDKCVec_C2Tuple_PublicKeyTypeZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ clone bytes"), .datalen = orig->datalen };
9671 for (size_t i = 0; i < ret.datalen; i++) {
9672 ret.data[i] = C2Tuple_PublicKeyTypeZ_clone(&orig->data[i]);
9676 typedef struct LDKCustomOnionMessageContents_JCalls {
9677 atomic_size_t refcnt;
9680 jmethodID tlv_type_meth;
9681 jmethodID write_meth;
9682 } LDKCustomOnionMessageContents_JCalls;
9683 static void LDKCustomOnionMessageContents_JCalls_free(void* this_arg) {
9684 LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
9685 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9687 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9688 if (get_jenv_res == JNI_EDETACHED) {
9689 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9691 DO_ASSERT(get_jenv_res == JNI_OK);
9693 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
9694 if (get_jenv_res == JNI_EDETACHED) {
9695 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9700 uint64_t tlv_type_LDKCustomOnionMessageContents_jcall(const void* this_arg) {
9701 LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
9703 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9704 if (get_jenv_res == JNI_EDETACHED) {
9705 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9707 DO_ASSERT(get_jenv_res == JNI_OK);
9709 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9711 int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->tlv_type_meth);
9712 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9713 (*env)->ExceptionDescribe(env);
9714 (*env)->FatalError(env, "A call to tlv_type in LDKCustomOnionMessageContents from rust threw an exception.");
9716 if (get_jenv_res == JNI_EDETACHED) {
9717 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9721 LDKCVec_u8Z write_LDKCustomOnionMessageContents_jcall(const void* this_arg) {
9722 LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
9724 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
9725 if (get_jenv_res == JNI_EDETACHED) {
9726 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
9728 DO_ASSERT(get_jenv_res == JNI_OK);
9730 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
9732 int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
9733 if (UNLIKELY((*env)->ExceptionCheck(env))) {
9734 (*env)->ExceptionDescribe(env);
9735 (*env)->FatalError(env, "A call to write in LDKCustomOnionMessageContents from rust threw an exception.");
9737 LDKCVec_u8Z ret_ref;
9738 ret_ref.datalen = (*env)->GetArrayLength(env, ret);
9739 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
9740 (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
9741 if (get_jenv_res == JNI_EDETACHED) {
9742 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
9746 static void LDKCustomOnionMessageContents_JCalls_cloned(LDKCustomOnionMessageContents* new_obj) {
9747 LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) new_obj->this_arg;
9748 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9750 static inline LDKCustomOnionMessageContents LDKCustomOnionMessageContents_init (JNIEnv *env, jclass clz, jobject o) {
9751 jclass c = (*env)->GetObjectClass(env, o);
9753 LDKCustomOnionMessageContents_JCalls *calls = MALLOC(sizeof(LDKCustomOnionMessageContents_JCalls), "LDKCustomOnionMessageContents_JCalls");
9754 atomic_init(&calls->refcnt, 1);
9755 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
9756 calls->o = (*env)->NewWeakGlobalRef(env, o);
9757 calls->tlv_type_meth = (*env)->GetMethodID(env, c, "tlv_type", "()J");
9758 CHECK(calls->tlv_type_meth != NULL);
9759 calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
9760 CHECK(calls->write_meth != NULL);
9762 LDKCustomOnionMessageContents ret = {
9763 .this_arg = (void*) calls,
9764 .tlv_type = tlv_type_LDKCustomOnionMessageContents_jcall,
9765 .write = write_LDKCustomOnionMessageContents_jcall,
9766 .cloned = LDKCustomOnionMessageContents_JCalls_cloned,
9767 .free = LDKCustomOnionMessageContents_JCalls_free,
9771 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomOnionMessageContents_1new(JNIEnv *env, jclass clz, jobject o) {
9772 LDKCustomOnionMessageContents *res_ptr = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
9773 *res_ptr = LDKCustomOnionMessageContents_init(env, clz, o);
9774 return tag_ptr(res_ptr, true);
9776 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1tlv_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
9777 void* this_arg_ptr = untag_ptr(this_arg);
9778 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9779 LDKCustomOnionMessageContents* this_arg_conv = (LDKCustomOnionMessageContents*)this_arg_ptr;
9780 int64_t ret_conv = (this_arg_conv->tlv_type)(this_arg_conv->this_arg);
9784 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
9785 void* this_arg_ptr = untag_ptr(this_arg);
9786 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9787 LDKCustomOnionMessageContents* this_arg_conv = (LDKCustomOnionMessageContents*)this_arg_ptr;
9788 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
9789 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
9790 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
9791 CVec_u8Z_free(ret_var);
9795 static jclass LDKCOption_CustomOnionMessageContentsZ_Some_class = NULL;
9796 static jmethodID LDKCOption_CustomOnionMessageContentsZ_Some_meth = NULL;
9797 static jclass LDKCOption_CustomOnionMessageContentsZ_None_class = NULL;
9798 static jmethodID LDKCOption_CustomOnionMessageContentsZ_None_meth = NULL;
9799 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CustomOnionMessageContentsZ_init (JNIEnv *env, jclass clz) {
9800 LDKCOption_CustomOnionMessageContentsZ_Some_class =
9801 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CustomOnionMessageContentsZ$Some"));
9802 CHECK(LDKCOption_CustomOnionMessageContentsZ_Some_class != NULL);
9803 LDKCOption_CustomOnionMessageContentsZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CustomOnionMessageContentsZ_Some_class, "<init>", "(J)V");
9804 CHECK(LDKCOption_CustomOnionMessageContentsZ_Some_meth != NULL);
9805 LDKCOption_CustomOnionMessageContentsZ_None_class =
9806 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CustomOnionMessageContentsZ$None"));
9807 CHECK(LDKCOption_CustomOnionMessageContentsZ_None_class != NULL);
9808 LDKCOption_CustomOnionMessageContentsZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CustomOnionMessageContentsZ_None_class, "<init>", "()V");
9809 CHECK(LDKCOption_CustomOnionMessageContentsZ_None_meth != NULL);
9811 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CustomOnionMessageContentsZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
9812 LDKCOption_CustomOnionMessageContentsZ *obj = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(ptr);
9814 case LDKCOption_CustomOnionMessageContentsZ_Some: {
9815 LDKCustomOnionMessageContents* some_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
9816 *some_ret = CustomOnionMessageContents_clone(&obj->some);
9817 return (*env)->NewObject(env, LDKCOption_CustomOnionMessageContentsZ_Some_class, LDKCOption_CustomOnionMessageContentsZ_Some_meth, tag_ptr(some_ret, true));
9819 case LDKCOption_CustomOnionMessageContentsZ_None: {
9820 return (*env)->NewObject(env, LDKCOption_CustomOnionMessageContentsZ_None_class, LDKCOption_CustomOnionMessageContentsZ_None_meth);
9825 static inline struct LDKCOption_CustomOnionMessageContentsZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner){
9826 CHECK(owner->result_ok);
9827 return COption_CustomOnionMessageContentsZ_clone(&*owner->contents.result);
9829 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9830 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* owner_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(owner);
9831 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
9832 *ret_copy = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(owner_conv);
9833 int64_t ret_ref = tag_ptr(ret_copy, true);
9837 static inline struct LDKDecodeError CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner){
9838 CHECK(!owner->result_ok);
9839 return DecodeError_clone(&*owner->contents.err);
9841 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9842 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* owner_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(owner);
9843 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
9844 *ret_copy = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(owner_conv);
9845 int64_t ret_ref = tag_ptr(ret_copy, true);
9849 static jclass LDKCOption_NetAddressZ_Some_class = NULL;
9850 static jmethodID LDKCOption_NetAddressZ_Some_meth = NULL;
9851 static jclass LDKCOption_NetAddressZ_None_class = NULL;
9852 static jmethodID LDKCOption_NetAddressZ_None_meth = NULL;
9853 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1NetAddressZ_init (JNIEnv *env, jclass clz) {
9854 LDKCOption_NetAddressZ_Some_class =
9855 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetAddressZ$Some"));
9856 CHECK(LDKCOption_NetAddressZ_Some_class != NULL);
9857 LDKCOption_NetAddressZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_NetAddressZ_Some_class, "<init>", "(J)V");
9858 CHECK(LDKCOption_NetAddressZ_Some_meth != NULL);
9859 LDKCOption_NetAddressZ_None_class =
9860 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_NetAddressZ$None"));
9861 CHECK(LDKCOption_NetAddressZ_None_class != NULL);
9862 LDKCOption_NetAddressZ_None_meth = (*env)->GetMethodID(env, LDKCOption_NetAddressZ_None_class, "<init>", "()V");
9863 CHECK(LDKCOption_NetAddressZ_None_meth != NULL);
9865 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1NetAddressZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
9866 LDKCOption_NetAddressZ *obj = (LDKCOption_NetAddressZ*)untag_ptr(ptr);
9868 case LDKCOption_NetAddressZ_Some: {
9869 int64_t some_ref = tag_ptr(&obj->some, false);
9870 return (*env)->NewObject(env, LDKCOption_NetAddressZ_Some_class, LDKCOption_NetAddressZ_Some_meth, some_ref);
9872 case LDKCOption_NetAddressZ_None: {
9873 return (*env)->NewObject(env, LDKCOption_NetAddressZ_None_class, LDKCOption_NetAddressZ_None_meth);
9878 static inline struct LDKPublicKey C2Tuple_PublicKeyCOption_NetAddressZZ_get_a(LDKC2Tuple_PublicKeyCOption_NetAddressZZ *NONNULL_PTR owner){
9881 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCOption_1NetAddressZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
9882 LDKC2Tuple_PublicKeyCOption_NetAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCOption_NetAddressZZ*)untag_ptr(owner);
9883 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
9884 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, C2Tuple_PublicKeyCOption_NetAddressZZ_get_a(owner_conv).compressed_form);
9888 static inline struct LDKCOption_NetAddressZ C2Tuple_PublicKeyCOption_NetAddressZZ_get_b(LDKC2Tuple_PublicKeyCOption_NetAddressZZ *NONNULL_PTR owner){
9889 return COption_NetAddressZ_clone(&owner->b);
9891 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCOption_1NetAddressZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
9892 LDKC2Tuple_PublicKeyCOption_NetAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCOption_NetAddressZZ*)untag_ptr(owner);
9893 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
9894 *ret_copy = C2Tuple_PublicKeyCOption_NetAddressZZ_get_b(owner_conv);
9895 int64_t ret_ref = tag_ptr(ret_copy, true);
9899 static inline LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ CVec_C2Tuple_PublicKeyCOption_NetAddressZZZ_clone(const LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ *orig) {
9900 LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_NetAddressZZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ clone bytes"), .datalen = orig->datalen };
9901 for (size_t i = 0; i < ret.datalen; i++) {
9902 ret.data[i] = C2Tuple_PublicKeyCOption_NetAddressZZ_clone(&orig->data[i]);
9906 static inline struct LDKCVec_u8Z CResult_CVec_u8ZPeerHandleErrorZ_get_ok(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){
9907 CHECK(owner->result_ok);
9908 return CVec_u8Z_clone(&*owner->contents.result);
9910 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9911 LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(owner);
9912 LDKCVec_u8Z ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_ok(owner_conv);
9913 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
9914 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
9915 CVec_u8Z_free(ret_var);
9919 static inline struct LDKPeerHandleError CResult_CVec_u8ZPeerHandleErrorZ_get_err(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){
9920 LDKPeerHandleError ret = *owner->contents.err;
9921 ret.is_owned = false;
9924 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9925 LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(owner);
9926 LDKPeerHandleError ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_err(owner_conv);
9927 int64_t ret_ref = 0;
9928 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9929 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9933 static inline void CResult_NonePeerHandleErrorZ_get_ok(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner){
9934 CHECK(owner->result_ok);
9935 return *owner->contents.result;
9937 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9938 LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(owner);
9939 CResult_NonePeerHandleErrorZ_get_ok(owner_conv);
9942 static inline struct LDKPeerHandleError CResult_NonePeerHandleErrorZ_get_err(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner){
9943 LDKPeerHandleError ret = *owner->contents.err;
9944 ret.is_owned = false;
9947 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9948 LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(owner);
9949 LDKPeerHandleError ret_var = CResult_NonePeerHandleErrorZ_get_err(owner_conv);
9950 int64_t ret_ref = 0;
9951 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9952 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9956 static inline bool CResult_boolPeerHandleErrorZ_get_ok(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner){
9957 CHECK(owner->result_ok);
9958 return *owner->contents.result;
9960 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
9961 LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(owner);
9962 jboolean ret_conv = CResult_boolPeerHandleErrorZ_get_ok(owner_conv);
9966 static inline struct LDKPeerHandleError CResult_boolPeerHandleErrorZ_get_err(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner){
9967 LDKPeerHandleError ret = *owner->contents.err;
9968 ret.is_owned = false;
9971 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
9972 LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(owner);
9973 LDKPeerHandleError ret_var = CResult_boolPeerHandleErrorZ_get_err(owner_conv);
9974 int64_t ret_ref = 0;
9975 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
9976 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
9980 static jclass LDKSendError_Secp256k1_class = NULL;
9981 static jmethodID LDKSendError_Secp256k1_meth = NULL;
9982 static jclass LDKSendError_TooBigPacket_class = NULL;
9983 static jmethodID LDKSendError_TooBigPacket_meth = NULL;
9984 static jclass LDKSendError_TooFewBlindedHops_class = NULL;
9985 static jmethodID LDKSendError_TooFewBlindedHops_meth = NULL;
9986 static jclass LDKSendError_InvalidFirstHop_class = NULL;
9987 static jmethodID LDKSendError_InvalidFirstHop_meth = NULL;
9988 static jclass LDKSendError_InvalidMessage_class = NULL;
9989 static jmethodID LDKSendError_InvalidMessage_meth = NULL;
9990 static jclass LDKSendError_BufferFull_class = NULL;
9991 static jmethodID LDKSendError_BufferFull_meth = NULL;
9992 static jclass LDKSendError_GetNodeIdFailed_class = NULL;
9993 static jmethodID LDKSendError_GetNodeIdFailed_meth = NULL;
9994 static jclass LDKSendError_BlindedPathAdvanceFailed_class = NULL;
9995 static jmethodID LDKSendError_BlindedPathAdvanceFailed_meth = NULL;
9996 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSendError_init (JNIEnv *env, jclass clz) {
9997 LDKSendError_Secp256k1_class =
9998 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$Secp256k1"));
9999 CHECK(LDKSendError_Secp256k1_class != NULL);
10000 LDKSendError_Secp256k1_meth = (*env)->GetMethodID(env, LDKSendError_Secp256k1_class, "<init>", "(Lorg/ldk/enums/Secp256k1Error;)V");
10001 CHECK(LDKSendError_Secp256k1_meth != NULL);
10002 LDKSendError_TooBigPacket_class =
10003 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$TooBigPacket"));
10004 CHECK(LDKSendError_TooBigPacket_class != NULL);
10005 LDKSendError_TooBigPacket_meth = (*env)->GetMethodID(env, LDKSendError_TooBigPacket_class, "<init>", "()V");
10006 CHECK(LDKSendError_TooBigPacket_meth != NULL);
10007 LDKSendError_TooFewBlindedHops_class =
10008 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$TooFewBlindedHops"));
10009 CHECK(LDKSendError_TooFewBlindedHops_class != NULL);
10010 LDKSendError_TooFewBlindedHops_meth = (*env)->GetMethodID(env, LDKSendError_TooFewBlindedHops_class, "<init>", "()V");
10011 CHECK(LDKSendError_TooFewBlindedHops_meth != NULL);
10012 LDKSendError_InvalidFirstHop_class =
10013 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$InvalidFirstHop"));
10014 CHECK(LDKSendError_InvalidFirstHop_class != NULL);
10015 LDKSendError_InvalidFirstHop_meth = (*env)->GetMethodID(env, LDKSendError_InvalidFirstHop_class, "<init>", "()V");
10016 CHECK(LDKSendError_InvalidFirstHop_meth != NULL);
10017 LDKSendError_InvalidMessage_class =
10018 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$InvalidMessage"));
10019 CHECK(LDKSendError_InvalidMessage_class != NULL);
10020 LDKSendError_InvalidMessage_meth = (*env)->GetMethodID(env, LDKSendError_InvalidMessage_class, "<init>", "()V");
10021 CHECK(LDKSendError_InvalidMessage_meth != NULL);
10022 LDKSendError_BufferFull_class =
10023 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$BufferFull"));
10024 CHECK(LDKSendError_BufferFull_class != NULL);
10025 LDKSendError_BufferFull_meth = (*env)->GetMethodID(env, LDKSendError_BufferFull_class, "<init>", "()V");
10026 CHECK(LDKSendError_BufferFull_meth != NULL);
10027 LDKSendError_GetNodeIdFailed_class =
10028 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$GetNodeIdFailed"));
10029 CHECK(LDKSendError_GetNodeIdFailed_class != NULL);
10030 LDKSendError_GetNodeIdFailed_meth = (*env)->GetMethodID(env, LDKSendError_GetNodeIdFailed_class, "<init>", "()V");
10031 CHECK(LDKSendError_GetNodeIdFailed_meth != NULL);
10032 LDKSendError_BlindedPathAdvanceFailed_class =
10033 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$BlindedPathAdvanceFailed"));
10034 CHECK(LDKSendError_BlindedPathAdvanceFailed_class != NULL);
10035 LDKSendError_BlindedPathAdvanceFailed_meth = (*env)->GetMethodID(env, LDKSendError_BlindedPathAdvanceFailed_class, "<init>", "()V");
10036 CHECK(LDKSendError_BlindedPathAdvanceFailed_meth != NULL);
10038 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSendError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
10039 LDKSendError *obj = (LDKSendError*)untag_ptr(ptr);
10041 case LDKSendError_Secp256k1: {
10042 jclass secp256k1_conv = LDKSecp256k1Error_to_java(env, obj->secp256k1);
10043 return (*env)->NewObject(env, LDKSendError_Secp256k1_class, LDKSendError_Secp256k1_meth, secp256k1_conv);
10045 case LDKSendError_TooBigPacket: {
10046 return (*env)->NewObject(env, LDKSendError_TooBigPacket_class, LDKSendError_TooBigPacket_meth);
10048 case LDKSendError_TooFewBlindedHops: {
10049 return (*env)->NewObject(env, LDKSendError_TooFewBlindedHops_class, LDKSendError_TooFewBlindedHops_meth);
10051 case LDKSendError_InvalidFirstHop: {
10052 return (*env)->NewObject(env, LDKSendError_InvalidFirstHop_class, LDKSendError_InvalidFirstHop_meth);
10054 case LDKSendError_InvalidMessage: {
10055 return (*env)->NewObject(env, LDKSendError_InvalidMessage_class, LDKSendError_InvalidMessage_meth);
10057 case LDKSendError_BufferFull: {
10058 return (*env)->NewObject(env, LDKSendError_BufferFull_class, LDKSendError_BufferFull_meth);
10060 case LDKSendError_GetNodeIdFailed: {
10061 return (*env)->NewObject(env, LDKSendError_GetNodeIdFailed_class, LDKSendError_GetNodeIdFailed_meth);
10063 case LDKSendError_BlindedPathAdvanceFailed: {
10064 return (*env)->NewObject(env, LDKSendError_BlindedPathAdvanceFailed_class, LDKSendError_BlindedPathAdvanceFailed_meth);
10069 static inline void CResult_NoneSendErrorZ_get_ok(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){
10070 CHECK(owner->result_ok);
10071 return *owner->contents.result;
10073 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10074 LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner);
10075 CResult_NoneSendErrorZ_get_ok(owner_conv);
10078 static inline struct LDKSendError CResult_NoneSendErrorZ_get_err(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner){
10079 CHECK(!owner->result_ok);
10080 return SendError_clone(&*owner->contents.err);
10082 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10083 LDKCResult_NoneSendErrorZ* owner_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(owner);
10084 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
10085 *ret_copy = CResult_NoneSendErrorZ_get_err(owner_conv);
10086 int64_t ret_ref = tag_ptr(ret_copy, true);
10090 static inline struct LDKBlindedPath CResult_BlindedPathNoneZ_get_ok(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner){
10091 LDKBlindedPath ret = *owner->contents.result;
10092 ret.is_owned = false;
10095 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10096 LDKCResult_BlindedPathNoneZ* owner_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(owner);
10097 LDKBlindedPath ret_var = CResult_BlindedPathNoneZ_get_ok(owner_conv);
10098 int64_t ret_ref = 0;
10099 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10100 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10104 static inline void CResult_BlindedPathNoneZ_get_err(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner){
10105 CHECK(!owner->result_ok);
10106 return *owner->contents.err;
10108 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10109 LDKCResult_BlindedPathNoneZ* owner_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(owner);
10110 CResult_BlindedPathNoneZ_get_err(owner_conv);
10113 static inline struct LDKBlindedPath CResult_BlindedPathDecodeErrorZ_get_ok(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner){
10114 LDKBlindedPath ret = *owner->contents.result;
10115 ret.is_owned = false;
10118 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10119 LDKCResult_BlindedPathDecodeErrorZ* owner_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(owner);
10120 LDKBlindedPath ret_var = CResult_BlindedPathDecodeErrorZ_get_ok(owner_conv);
10121 int64_t ret_ref = 0;
10122 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10123 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10127 static inline struct LDKDecodeError CResult_BlindedPathDecodeErrorZ_get_err(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner){
10128 CHECK(!owner->result_ok);
10129 return DecodeError_clone(&*owner->contents.err);
10131 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10132 LDKCResult_BlindedPathDecodeErrorZ* owner_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(owner);
10133 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10134 *ret_copy = CResult_BlindedPathDecodeErrorZ_get_err(owner_conv);
10135 int64_t ret_ref = tag_ptr(ret_copy, true);
10139 static inline struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){
10140 LDKBlindedHop ret = *owner->contents.result;
10141 ret.is_owned = false;
10144 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10145 LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner);
10146 LDKBlindedHop ret_var = CResult_BlindedHopDecodeErrorZ_get_ok(owner_conv);
10147 int64_t ret_ref = 0;
10148 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10149 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10153 static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){
10154 CHECK(!owner->result_ok);
10155 return DecodeError_clone(&*owner->contents.err);
10157 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10158 LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner);
10159 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10160 *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv);
10161 int64_t ret_ref = tag_ptr(ret_copy, true);
10165 static jclass LDKParseError_Bech32Error_class = NULL;
10166 static jmethodID LDKParseError_Bech32Error_meth = NULL;
10167 static jclass LDKParseError_ParseAmountError_class = NULL;
10168 static jmethodID LDKParseError_ParseAmountError_meth = NULL;
10169 static jclass LDKParseError_MalformedSignature_class = NULL;
10170 static jmethodID LDKParseError_MalformedSignature_meth = NULL;
10171 static jclass LDKParseError_BadPrefix_class = NULL;
10172 static jmethodID LDKParseError_BadPrefix_meth = NULL;
10173 static jclass LDKParseError_UnknownCurrency_class = NULL;
10174 static jmethodID LDKParseError_UnknownCurrency_meth = NULL;
10175 static jclass LDKParseError_UnknownSiPrefix_class = NULL;
10176 static jmethodID LDKParseError_UnknownSiPrefix_meth = NULL;
10177 static jclass LDKParseError_MalformedHRP_class = NULL;
10178 static jmethodID LDKParseError_MalformedHRP_meth = NULL;
10179 static jclass LDKParseError_TooShortDataPart_class = NULL;
10180 static jmethodID LDKParseError_TooShortDataPart_meth = NULL;
10181 static jclass LDKParseError_UnexpectedEndOfTaggedFields_class = NULL;
10182 static jmethodID LDKParseError_UnexpectedEndOfTaggedFields_meth = NULL;
10183 static jclass LDKParseError_DescriptionDecodeError_class = NULL;
10184 static jmethodID LDKParseError_DescriptionDecodeError_meth = NULL;
10185 static jclass LDKParseError_PaddingError_class = NULL;
10186 static jmethodID LDKParseError_PaddingError_meth = NULL;
10187 static jclass LDKParseError_IntegerOverflowError_class = NULL;
10188 static jmethodID LDKParseError_IntegerOverflowError_meth = NULL;
10189 static jclass LDKParseError_InvalidSegWitProgramLength_class = NULL;
10190 static jmethodID LDKParseError_InvalidSegWitProgramLength_meth = NULL;
10191 static jclass LDKParseError_InvalidPubKeyHashLength_class = NULL;
10192 static jmethodID LDKParseError_InvalidPubKeyHashLength_meth = NULL;
10193 static jclass LDKParseError_InvalidScriptHashLength_class = NULL;
10194 static jmethodID LDKParseError_InvalidScriptHashLength_meth = NULL;
10195 static jclass LDKParseError_InvalidRecoveryId_class = NULL;
10196 static jmethodID LDKParseError_InvalidRecoveryId_meth = NULL;
10197 static jclass LDKParseError_InvalidSliceLength_class = NULL;
10198 static jmethodID LDKParseError_InvalidSliceLength_meth = NULL;
10199 static jclass LDKParseError_Skip_class = NULL;
10200 static jmethodID LDKParseError_Skip_meth = NULL;
10201 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParseError_init (JNIEnv *env, jclass clz) {
10202 LDKParseError_Bech32Error_class =
10203 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$Bech32Error"));
10204 CHECK(LDKParseError_Bech32Error_class != NULL);
10205 LDKParseError_Bech32Error_meth = (*env)->GetMethodID(env, LDKParseError_Bech32Error_class, "<init>", "(J)V");
10206 CHECK(LDKParseError_Bech32Error_meth != NULL);
10207 LDKParseError_ParseAmountError_class =
10208 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$ParseAmountError"));
10209 CHECK(LDKParseError_ParseAmountError_class != NULL);
10210 LDKParseError_ParseAmountError_meth = (*env)->GetMethodID(env, LDKParseError_ParseAmountError_class, "<init>", "(I)V");
10211 CHECK(LDKParseError_ParseAmountError_meth != NULL);
10212 LDKParseError_MalformedSignature_class =
10213 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$MalformedSignature"));
10214 CHECK(LDKParseError_MalformedSignature_class != NULL);
10215 LDKParseError_MalformedSignature_meth = (*env)->GetMethodID(env, LDKParseError_MalformedSignature_class, "<init>", "(Lorg/ldk/enums/Secp256k1Error;)V");
10216 CHECK(LDKParseError_MalformedSignature_meth != NULL);
10217 LDKParseError_BadPrefix_class =
10218 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$BadPrefix"));
10219 CHECK(LDKParseError_BadPrefix_class != NULL);
10220 LDKParseError_BadPrefix_meth = (*env)->GetMethodID(env, LDKParseError_BadPrefix_class, "<init>", "()V");
10221 CHECK(LDKParseError_BadPrefix_meth != NULL);
10222 LDKParseError_UnknownCurrency_class =
10223 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnknownCurrency"));
10224 CHECK(LDKParseError_UnknownCurrency_class != NULL);
10225 LDKParseError_UnknownCurrency_meth = (*env)->GetMethodID(env, LDKParseError_UnknownCurrency_class, "<init>", "()V");
10226 CHECK(LDKParseError_UnknownCurrency_meth != NULL);
10227 LDKParseError_UnknownSiPrefix_class =
10228 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnknownSiPrefix"));
10229 CHECK(LDKParseError_UnknownSiPrefix_class != NULL);
10230 LDKParseError_UnknownSiPrefix_meth = (*env)->GetMethodID(env, LDKParseError_UnknownSiPrefix_class, "<init>", "()V");
10231 CHECK(LDKParseError_UnknownSiPrefix_meth != NULL);
10232 LDKParseError_MalformedHRP_class =
10233 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$MalformedHRP"));
10234 CHECK(LDKParseError_MalformedHRP_class != NULL);
10235 LDKParseError_MalformedHRP_meth = (*env)->GetMethodID(env, LDKParseError_MalformedHRP_class, "<init>", "()V");
10236 CHECK(LDKParseError_MalformedHRP_meth != NULL);
10237 LDKParseError_TooShortDataPart_class =
10238 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$TooShortDataPart"));
10239 CHECK(LDKParseError_TooShortDataPart_class != NULL);
10240 LDKParseError_TooShortDataPart_meth = (*env)->GetMethodID(env, LDKParseError_TooShortDataPart_class, "<init>", "()V");
10241 CHECK(LDKParseError_TooShortDataPart_meth != NULL);
10242 LDKParseError_UnexpectedEndOfTaggedFields_class =
10243 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnexpectedEndOfTaggedFields"));
10244 CHECK(LDKParseError_UnexpectedEndOfTaggedFields_class != NULL);
10245 LDKParseError_UnexpectedEndOfTaggedFields_meth = (*env)->GetMethodID(env, LDKParseError_UnexpectedEndOfTaggedFields_class, "<init>", "()V");
10246 CHECK(LDKParseError_UnexpectedEndOfTaggedFields_meth != NULL);
10247 LDKParseError_DescriptionDecodeError_class =
10248 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$DescriptionDecodeError"));
10249 CHECK(LDKParseError_DescriptionDecodeError_class != NULL);
10250 LDKParseError_DescriptionDecodeError_meth = (*env)->GetMethodID(env, LDKParseError_DescriptionDecodeError_class, "<init>", "(I)V");
10251 CHECK(LDKParseError_DescriptionDecodeError_meth != NULL);
10252 LDKParseError_PaddingError_class =
10253 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$PaddingError"));
10254 CHECK(LDKParseError_PaddingError_class != NULL);
10255 LDKParseError_PaddingError_meth = (*env)->GetMethodID(env, LDKParseError_PaddingError_class, "<init>", "()V");
10256 CHECK(LDKParseError_PaddingError_meth != NULL);
10257 LDKParseError_IntegerOverflowError_class =
10258 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$IntegerOverflowError"));
10259 CHECK(LDKParseError_IntegerOverflowError_class != NULL);
10260 LDKParseError_IntegerOverflowError_meth = (*env)->GetMethodID(env, LDKParseError_IntegerOverflowError_class, "<init>", "()V");
10261 CHECK(LDKParseError_IntegerOverflowError_meth != NULL);
10262 LDKParseError_InvalidSegWitProgramLength_class =
10263 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidSegWitProgramLength"));
10264 CHECK(LDKParseError_InvalidSegWitProgramLength_class != NULL);
10265 LDKParseError_InvalidSegWitProgramLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidSegWitProgramLength_class, "<init>", "()V");
10266 CHECK(LDKParseError_InvalidSegWitProgramLength_meth != NULL);
10267 LDKParseError_InvalidPubKeyHashLength_class =
10268 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidPubKeyHashLength"));
10269 CHECK(LDKParseError_InvalidPubKeyHashLength_class != NULL);
10270 LDKParseError_InvalidPubKeyHashLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidPubKeyHashLength_class, "<init>", "()V");
10271 CHECK(LDKParseError_InvalidPubKeyHashLength_meth != NULL);
10272 LDKParseError_InvalidScriptHashLength_class =
10273 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidScriptHashLength"));
10274 CHECK(LDKParseError_InvalidScriptHashLength_class != NULL);
10275 LDKParseError_InvalidScriptHashLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidScriptHashLength_class, "<init>", "()V");
10276 CHECK(LDKParseError_InvalidScriptHashLength_meth != NULL);
10277 LDKParseError_InvalidRecoveryId_class =
10278 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidRecoveryId"));
10279 CHECK(LDKParseError_InvalidRecoveryId_class != NULL);
10280 LDKParseError_InvalidRecoveryId_meth = (*env)->GetMethodID(env, LDKParseError_InvalidRecoveryId_class, "<init>", "()V");
10281 CHECK(LDKParseError_InvalidRecoveryId_meth != NULL);
10282 LDKParseError_InvalidSliceLength_class =
10283 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidSliceLength"));
10284 CHECK(LDKParseError_InvalidSliceLength_class != NULL);
10285 LDKParseError_InvalidSliceLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidSliceLength_class, "<init>", "(Ljava/lang/String;)V");
10286 CHECK(LDKParseError_InvalidSliceLength_meth != NULL);
10287 LDKParseError_Skip_class =
10288 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$Skip"));
10289 CHECK(LDKParseError_Skip_class != NULL);
10290 LDKParseError_Skip_meth = (*env)->GetMethodID(env, LDKParseError_Skip_class, "<init>", "()V");
10291 CHECK(LDKParseError_Skip_meth != NULL);
10293 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
10294 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
10296 case LDKParseError_Bech32Error: {
10297 int64_t bech32_error_ref = tag_ptr(&obj->bech32_error, false);
10298 return (*env)->NewObject(env, LDKParseError_Bech32Error_class, LDKParseError_Bech32Error_meth, bech32_error_ref);
10300 case LDKParseError_ParseAmountError: {
10301 /*obj->parse_amount_error*/
10302 return (*env)->NewObject(env, LDKParseError_ParseAmountError_class, LDKParseError_ParseAmountError_meth, 0);
10304 case LDKParseError_MalformedSignature: {
10305 jclass malformed_signature_conv = LDKSecp256k1Error_to_java(env, obj->malformed_signature);
10306 return (*env)->NewObject(env, LDKParseError_MalformedSignature_class, LDKParseError_MalformedSignature_meth, malformed_signature_conv);
10308 case LDKParseError_BadPrefix: {
10309 return (*env)->NewObject(env, LDKParseError_BadPrefix_class, LDKParseError_BadPrefix_meth);
10311 case LDKParseError_UnknownCurrency: {
10312 return (*env)->NewObject(env, LDKParseError_UnknownCurrency_class, LDKParseError_UnknownCurrency_meth);
10314 case LDKParseError_UnknownSiPrefix: {
10315 return (*env)->NewObject(env, LDKParseError_UnknownSiPrefix_class, LDKParseError_UnknownSiPrefix_meth);
10317 case LDKParseError_MalformedHRP: {
10318 return (*env)->NewObject(env, LDKParseError_MalformedHRP_class, LDKParseError_MalformedHRP_meth);
10320 case LDKParseError_TooShortDataPart: {
10321 return (*env)->NewObject(env, LDKParseError_TooShortDataPart_class, LDKParseError_TooShortDataPart_meth);
10323 case LDKParseError_UnexpectedEndOfTaggedFields: {
10324 return (*env)->NewObject(env, LDKParseError_UnexpectedEndOfTaggedFields_class, LDKParseError_UnexpectedEndOfTaggedFields_meth);
10326 case LDKParseError_DescriptionDecodeError: {
10327 /*obj->description_decode_error*/
10328 return (*env)->NewObject(env, LDKParseError_DescriptionDecodeError_class, LDKParseError_DescriptionDecodeError_meth, 0);
10330 case LDKParseError_PaddingError: {
10331 return (*env)->NewObject(env, LDKParseError_PaddingError_class, LDKParseError_PaddingError_meth);
10333 case LDKParseError_IntegerOverflowError: {
10334 return (*env)->NewObject(env, LDKParseError_IntegerOverflowError_class, LDKParseError_IntegerOverflowError_meth);
10336 case LDKParseError_InvalidSegWitProgramLength: {
10337 return (*env)->NewObject(env, LDKParseError_InvalidSegWitProgramLength_class, LDKParseError_InvalidSegWitProgramLength_meth);
10339 case LDKParseError_InvalidPubKeyHashLength: {
10340 return (*env)->NewObject(env, LDKParseError_InvalidPubKeyHashLength_class, LDKParseError_InvalidPubKeyHashLength_meth);
10342 case LDKParseError_InvalidScriptHashLength: {
10343 return (*env)->NewObject(env, LDKParseError_InvalidScriptHashLength_class, LDKParseError_InvalidScriptHashLength_meth);
10345 case LDKParseError_InvalidRecoveryId: {
10346 return (*env)->NewObject(env, LDKParseError_InvalidRecoveryId_class, LDKParseError_InvalidRecoveryId_meth);
10348 case LDKParseError_InvalidSliceLength: {
10349 LDKStr invalid_slice_length_str = obj->invalid_slice_length;
10350 jstring invalid_slice_length_conv = str_ref_to_java(env, invalid_slice_length_str.chars, invalid_slice_length_str.len);
10351 return (*env)->NewObject(env, LDKParseError_InvalidSliceLength_class, LDKParseError_InvalidSliceLength_meth, invalid_slice_length_conv);
10353 case LDKParseError_Skip: {
10354 return (*env)->NewObject(env, LDKParseError_Skip_class, LDKParseError_Skip_meth);
10359 static inline enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
10360 CHECK(owner->result_ok);
10361 return SiPrefix_clone(&*owner->contents.result);
10363 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10364 LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
10365 jclass ret_conv = LDKSiPrefix_to_java(env, CResult_SiPrefixParseErrorZ_get_ok(owner_conv));
10369 static inline struct LDKParseError CResult_SiPrefixParseErrorZ_get_err(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
10370 CHECK(!owner->result_ok);
10371 return ParseError_clone(&*owner->contents.err);
10373 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10374 LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
10375 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
10376 *ret_copy = CResult_SiPrefixParseErrorZ_get_err(owner_conv);
10377 int64_t ret_ref = tag_ptr(ret_copy, true);
10381 static jclass LDKParseOrSemanticError_ParseError_class = NULL;
10382 static jmethodID LDKParseOrSemanticError_ParseError_meth = NULL;
10383 static jclass LDKParseOrSemanticError_SemanticError_class = NULL;
10384 static jmethodID LDKParseOrSemanticError_SemanticError_meth = NULL;
10385 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParseOrSemanticError_init (JNIEnv *env, jclass clz) {
10386 LDKParseOrSemanticError_ParseError_class =
10387 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseOrSemanticError$ParseError"));
10388 CHECK(LDKParseOrSemanticError_ParseError_class != NULL);
10389 LDKParseOrSemanticError_ParseError_meth = (*env)->GetMethodID(env, LDKParseOrSemanticError_ParseError_class, "<init>", "(J)V");
10390 CHECK(LDKParseOrSemanticError_ParseError_meth != NULL);
10391 LDKParseOrSemanticError_SemanticError_class =
10392 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseOrSemanticError$SemanticError"));
10393 CHECK(LDKParseOrSemanticError_SemanticError_class != NULL);
10394 LDKParseOrSemanticError_SemanticError_meth = (*env)->GetMethodID(env, LDKParseOrSemanticError_SemanticError_class, "<init>", "(Lorg/ldk/enums/SemanticError;)V");
10395 CHECK(LDKParseOrSemanticError_SemanticError_meth != NULL);
10397 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseOrSemanticError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
10398 LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
10400 case LDKParseOrSemanticError_ParseError: {
10401 int64_t parse_error_ref = tag_ptr(&obj->parse_error, false);
10402 return (*env)->NewObject(env, LDKParseOrSemanticError_ParseError_class, LDKParseOrSemanticError_ParseError_meth, parse_error_ref);
10404 case LDKParseOrSemanticError_SemanticError: {
10405 jclass semantic_error_conv = LDKSemanticError_to_java(env, obj->semantic_error);
10406 return (*env)->NewObject(env, LDKParseOrSemanticError_SemanticError_class, LDKParseOrSemanticError_SemanticError_meth, semantic_error_conv);
10411 static inline struct LDKInvoice CResult_InvoiceParseOrSemanticErrorZ_get_ok(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
10412 LDKInvoice ret = *owner->contents.result;
10413 ret.is_owned = false;
10416 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10417 LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
10418 LDKInvoice ret_var = CResult_InvoiceParseOrSemanticErrorZ_get_ok(owner_conv);
10419 int64_t ret_ref = 0;
10420 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10421 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10425 static inline struct LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
10426 CHECK(!owner->result_ok);
10427 return ParseOrSemanticError_clone(&*owner->contents.err);
10429 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10430 LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
10431 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
10432 *ret_copy = CResult_InvoiceParseOrSemanticErrorZ_get_err(owner_conv);
10433 int64_t ret_ref = tag_ptr(ret_copy, true);
10437 static inline struct LDKSignedRawInvoice CResult_SignedRawInvoiceParseErrorZ_get_ok(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
10438 LDKSignedRawInvoice ret = *owner->contents.result;
10439 ret.is_owned = false;
10442 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10443 LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
10444 LDKSignedRawInvoice ret_var = CResult_SignedRawInvoiceParseErrorZ_get_ok(owner_conv);
10445 int64_t ret_ref = 0;
10446 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10447 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10451 static inline struct LDKParseError CResult_SignedRawInvoiceParseErrorZ_get_err(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
10452 CHECK(!owner->result_ok);
10453 return ParseError_clone(&*owner->contents.err);
10455 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10456 LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
10457 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
10458 *ret_copy = CResult_SignedRawInvoiceParseErrorZ_get_err(owner_conv);
10459 int64_t ret_ref = tag_ptr(ret_copy, true);
10463 static inline struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
10464 LDKRawInvoice ret = owner->a;
10465 ret.is_owned = false;
10468 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
10469 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
10470 LDKRawInvoice ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(owner_conv);
10471 int64_t ret_ref = 0;
10472 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10473 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10477 static inline struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
10478 return ThirtyTwoBytes_clone(&owner->b);
10480 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
10481 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
10482 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
10483 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(owner_conv).data);
10487 static inline struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
10488 LDKInvoiceSignature ret = owner->c;
10489 ret.is_owned = false;
10492 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) {
10493 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
10494 LDKInvoiceSignature ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(owner_conv);
10495 int64_t ret_ref = 0;
10496 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10497 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10501 static inline struct LDKPayeePubKey CResult_PayeePubKeyErrorZ_get_ok(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
10502 LDKPayeePubKey ret = *owner->contents.result;
10503 ret.is_owned = false;
10506 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10507 LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
10508 LDKPayeePubKey ret_var = CResult_PayeePubKeyErrorZ_get_ok(owner_conv);
10509 int64_t ret_ref = 0;
10510 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10511 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10515 static inline enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
10516 CHECK(!owner->result_ok);
10517 return *owner->contents.err;
10519 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10520 LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
10521 jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_PayeePubKeyErrorZ_get_err(owner_conv));
10525 static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) {
10526 LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen };
10527 for (size_t i = 0; i < ret.datalen; i++) {
10528 ret.data[i] = PrivateRoute_clone(&orig->data[i]);
10532 static inline struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
10533 LDKPositiveTimestamp ret = *owner->contents.result;
10534 ret.is_owned = false;
10537 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10538 LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
10539 LDKPositiveTimestamp ret_var = CResult_PositiveTimestampCreationErrorZ_get_ok(owner_conv);
10540 int64_t ret_ref = 0;
10541 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10542 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10546 static inline enum LDKCreationError CResult_PositiveTimestampCreationErrorZ_get_err(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
10547 CHECK(!owner->result_ok);
10548 return CreationError_clone(&*owner->contents.err);
10550 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10551 LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
10552 jclass ret_conv = LDKCreationError_to_java(env, CResult_PositiveTimestampCreationErrorZ_get_err(owner_conv));
10556 static inline void CResult_NoneSemanticErrorZ_get_ok(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
10557 CHECK(owner->result_ok);
10558 return *owner->contents.result;
10560 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10561 LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
10562 CResult_NoneSemanticErrorZ_get_ok(owner_conv);
10565 static inline enum LDKSemanticError CResult_NoneSemanticErrorZ_get_err(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
10566 CHECK(!owner->result_ok);
10567 return SemanticError_clone(&*owner->contents.err);
10569 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10570 LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
10571 jclass ret_conv = LDKSemanticError_to_java(env, CResult_NoneSemanticErrorZ_get_err(owner_conv));
10575 static inline struct LDKInvoice CResult_InvoiceSemanticErrorZ_get_ok(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
10576 LDKInvoice ret = *owner->contents.result;
10577 ret.is_owned = false;
10580 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10581 LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
10582 LDKInvoice ret_var = CResult_InvoiceSemanticErrorZ_get_ok(owner_conv);
10583 int64_t ret_ref = 0;
10584 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10585 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10589 static inline enum LDKSemanticError CResult_InvoiceSemanticErrorZ_get_err(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
10590 CHECK(!owner->result_ok);
10591 return SemanticError_clone(&*owner->contents.err);
10593 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10594 LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
10595 jclass ret_conv = LDKSemanticError_to_java(env, CResult_InvoiceSemanticErrorZ_get_err(owner_conv));
10599 static inline struct LDKDescription CResult_DescriptionCreationErrorZ_get_ok(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
10600 LDKDescription ret = *owner->contents.result;
10601 ret.is_owned = false;
10604 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10605 LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
10606 LDKDescription ret_var = CResult_DescriptionCreationErrorZ_get_ok(owner_conv);
10607 int64_t ret_ref = 0;
10608 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10609 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10613 static inline enum LDKCreationError CResult_DescriptionCreationErrorZ_get_err(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
10614 CHECK(!owner->result_ok);
10615 return CreationError_clone(&*owner->contents.err);
10617 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10618 LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
10619 jclass ret_conv = LDKCreationError_to_java(env, CResult_DescriptionCreationErrorZ_get_err(owner_conv));
10623 static inline struct LDKPrivateRoute CResult_PrivateRouteCreationErrorZ_get_ok(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
10624 LDKPrivateRoute ret = *owner->contents.result;
10625 ret.is_owned = false;
10628 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10629 LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
10630 LDKPrivateRoute ret_var = CResult_PrivateRouteCreationErrorZ_get_ok(owner_conv);
10631 int64_t ret_ref = 0;
10632 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10633 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10637 static inline enum LDKCreationError CResult_PrivateRouteCreationErrorZ_get_err(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
10638 CHECK(!owner->result_ok);
10639 return CreationError_clone(&*owner->contents.err);
10641 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10642 LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
10643 jclass ret_conv = LDKCreationError_to_java(env, CResult_PrivateRouteCreationErrorZ_get_err(owner_conv));
10647 static inline struct LDKNetAddress CResult_NetAddressDecodeErrorZ_get_ok(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
10648 CHECK(owner->result_ok);
10649 return NetAddress_clone(&*owner->contents.result);
10651 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10652 LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
10653 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
10654 *ret_copy = CResult_NetAddressDecodeErrorZ_get_ok(owner_conv);
10655 int64_t ret_ref = tag_ptr(ret_copy, true);
10659 static inline struct LDKDecodeError CResult_NetAddressDecodeErrorZ_get_err(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
10660 CHECK(!owner->result_ok);
10661 return DecodeError_clone(&*owner->contents.err);
10663 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10664 LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
10665 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10666 *ret_copy = CResult_NetAddressDecodeErrorZ_get_err(owner_conv);
10667 int64_t ret_ref = tag_ptr(ret_copy, true);
10671 static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_UpdateAddHTLCZ *orig) {
10672 LDKCVec_UpdateAddHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateAddHTLC) * orig->datalen, "LDKCVec_UpdateAddHTLCZ clone bytes"), .datalen = orig->datalen };
10673 for (size_t i = 0; i < ret.datalen; i++) {
10674 ret.data[i] = UpdateAddHTLC_clone(&orig->data[i]);
10678 static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDKCVec_UpdateFulfillHTLCZ *orig) {
10679 LDKCVec_UpdateFulfillHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * orig->datalen, "LDKCVec_UpdateFulfillHTLCZ clone bytes"), .datalen = orig->datalen };
10680 for (size_t i = 0; i < ret.datalen; i++) {
10681 ret.data[i] = UpdateFulfillHTLC_clone(&orig->data[i]);
10685 static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_UpdateFailHTLCZ *orig) {
10686 LDKCVec_UpdateFailHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailHTLC) * orig->datalen, "LDKCVec_UpdateFailHTLCZ clone bytes"), .datalen = orig->datalen };
10687 for (size_t i = 0; i < ret.datalen; i++) {
10688 ret.data[i] = UpdateFailHTLC_clone(&orig->data[i]);
10692 static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clone(const LDKCVec_UpdateFailMalformedHTLCZ *orig) {
10693 LDKCVec_UpdateFailMalformedHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * orig->datalen, "LDKCVec_UpdateFailMalformedHTLCZ clone bytes"), .datalen = orig->datalen };
10694 for (size_t i = 0; i < ret.datalen; i++) {
10695 ret.data[i] = UpdateFailMalformedHTLC_clone(&orig->data[i]);
10699 static inline struct LDKAcceptChannel CResult_AcceptChannelDecodeErrorZ_get_ok(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
10700 LDKAcceptChannel ret = *owner->contents.result;
10701 ret.is_owned = false;
10704 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10705 LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
10706 LDKAcceptChannel ret_var = CResult_AcceptChannelDecodeErrorZ_get_ok(owner_conv);
10707 int64_t ret_ref = 0;
10708 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10709 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10713 static inline struct LDKDecodeError CResult_AcceptChannelDecodeErrorZ_get_err(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
10714 CHECK(!owner->result_ok);
10715 return DecodeError_clone(&*owner->contents.err);
10717 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10718 LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
10719 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10720 *ret_copy = CResult_AcceptChannelDecodeErrorZ_get_err(owner_conv);
10721 int64_t ret_ref = tag_ptr(ret_copy, true);
10725 static inline struct LDKAnnouncementSignatures CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
10726 LDKAnnouncementSignatures ret = *owner->contents.result;
10727 ret.is_owned = false;
10730 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10731 LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
10732 LDKAnnouncementSignatures ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(owner_conv);
10733 int64_t ret_ref = 0;
10734 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10735 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10739 static inline struct LDKDecodeError CResult_AnnouncementSignaturesDecodeErrorZ_get_err(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
10740 CHECK(!owner->result_ok);
10741 return DecodeError_clone(&*owner->contents.err);
10743 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10744 LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
10745 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10746 *ret_copy = CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner_conv);
10747 int64_t ret_ref = tag_ptr(ret_copy, true);
10751 static inline struct LDKChannelReestablish CResult_ChannelReestablishDecodeErrorZ_get_ok(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
10752 LDKChannelReestablish ret = *owner->contents.result;
10753 ret.is_owned = false;
10756 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10757 LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
10758 LDKChannelReestablish ret_var = CResult_ChannelReestablishDecodeErrorZ_get_ok(owner_conv);
10759 int64_t ret_ref = 0;
10760 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10761 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10765 static inline struct LDKDecodeError CResult_ChannelReestablishDecodeErrorZ_get_err(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
10766 CHECK(!owner->result_ok);
10767 return DecodeError_clone(&*owner->contents.err);
10769 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10770 LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
10771 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10772 *ret_copy = CResult_ChannelReestablishDecodeErrorZ_get_err(owner_conv);
10773 int64_t ret_ref = tag_ptr(ret_copy, true);
10777 static inline struct LDKClosingSigned CResult_ClosingSignedDecodeErrorZ_get_ok(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
10778 LDKClosingSigned ret = *owner->contents.result;
10779 ret.is_owned = false;
10782 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10783 LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
10784 LDKClosingSigned ret_var = CResult_ClosingSignedDecodeErrorZ_get_ok(owner_conv);
10785 int64_t ret_ref = 0;
10786 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10787 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10791 static inline struct LDKDecodeError CResult_ClosingSignedDecodeErrorZ_get_err(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
10792 CHECK(!owner->result_ok);
10793 return DecodeError_clone(&*owner->contents.err);
10795 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10796 LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
10797 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10798 *ret_copy = CResult_ClosingSignedDecodeErrorZ_get_err(owner_conv);
10799 int64_t ret_ref = tag_ptr(ret_copy, true);
10803 static inline struct LDKClosingSignedFeeRange CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
10804 LDKClosingSignedFeeRange ret = *owner->contents.result;
10805 ret.is_owned = false;
10808 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10809 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
10810 LDKClosingSignedFeeRange ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(owner_conv);
10811 int64_t ret_ref = 0;
10812 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10813 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10817 static inline struct LDKDecodeError CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
10818 CHECK(!owner->result_ok);
10819 return DecodeError_clone(&*owner->contents.err);
10821 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10822 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
10823 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10824 *ret_copy = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner_conv);
10825 int64_t ret_ref = tag_ptr(ret_copy, true);
10829 static inline struct LDKCommitmentSigned CResult_CommitmentSignedDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
10830 LDKCommitmentSigned ret = *owner->contents.result;
10831 ret.is_owned = false;
10834 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10835 LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
10836 LDKCommitmentSigned ret_var = CResult_CommitmentSignedDecodeErrorZ_get_ok(owner_conv);
10837 int64_t ret_ref = 0;
10838 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10839 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10843 static inline struct LDKDecodeError CResult_CommitmentSignedDecodeErrorZ_get_err(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
10844 CHECK(!owner->result_ok);
10845 return DecodeError_clone(&*owner->contents.err);
10847 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10848 LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
10849 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10850 *ret_copy = CResult_CommitmentSignedDecodeErrorZ_get_err(owner_conv);
10851 int64_t ret_ref = tag_ptr(ret_copy, true);
10855 static inline struct LDKFundingCreated CResult_FundingCreatedDecodeErrorZ_get_ok(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
10856 LDKFundingCreated ret = *owner->contents.result;
10857 ret.is_owned = false;
10860 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10861 LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
10862 LDKFundingCreated ret_var = CResult_FundingCreatedDecodeErrorZ_get_ok(owner_conv);
10863 int64_t ret_ref = 0;
10864 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10865 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10869 static inline struct LDKDecodeError CResult_FundingCreatedDecodeErrorZ_get_err(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
10870 CHECK(!owner->result_ok);
10871 return DecodeError_clone(&*owner->contents.err);
10873 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10874 LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
10875 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10876 *ret_copy = CResult_FundingCreatedDecodeErrorZ_get_err(owner_conv);
10877 int64_t ret_ref = tag_ptr(ret_copy, true);
10881 static inline struct LDKFundingSigned CResult_FundingSignedDecodeErrorZ_get_ok(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
10882 LDKFundingSigned ret = *owner->contents.result;
10883 ret.is_owned = false;
10886 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10887 LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
10888 LDKFundingSigned ret_var = CResult_FundingSignedDecodeErrorZ_get_ok(owner_conv);
10889 int64_t ret_ref = 0;
10890 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10891 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10895 static inline struct LDKDecodeError CResult_FundingSignedDecodeErrorZ_get_err(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
10896 CHECK(!owner->result_ok);
10897 return DecodeError_clone(&*owner->contents.err);
10899 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10900 LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
10901 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10902 *ret_copy = CResult_FundingSignedDecodeErrorZ_get_err(owner_conv);
10903 int64_t ret_ref = tag_ptr(ret_copy, true);
10907 static inline struct LDKChannelReady CResult_ChannelReadyDecodeErrorZ_get_ok(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
10908 LDKChannelReady ret = *owner->contents.result;
10909 ret.is_owned = false;
10912 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10913 LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
10914 LDKChannelReady ret_var = CResult_ChannelReadyDecodeErrorZ_get_ok(owner_conv);
10915 int64_t ret_ref = 0;
10916 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10917 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10921 static inline struct LDKDecodeError CResult_ChannelReadyDecodeErrorZ_get_err(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
10922 CHECK(!owner->result_ok);
10923 return DecodeError_clone(&*owner->contents.err);
10925 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10926 LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
10927 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10928 *ret_copy = CResult_ChannelReadyDecodeErrorZ_get_err(owner_conv);
10929 int64_t ret_ref = tag_ptr(ret_copy, true);
10933 static inline struct LDKInit CResult_InitDecodeErrorZ_get_ok(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
10934 LDKInit ret = *owner->contents.result;
10935 ret.is_owned = false;
10938 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10939 LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
10940 LDKInit ret_var = CResult_InitDecodeErrorZ_get_ok(owner_conv);
10941 int64_t ret_ref = 0;
10942 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10943 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10947 static inline struct LDKDecodeError CResult_InitDecodeErrorZ_get_err(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
10948 CHECK(!owner->result_ok);
10949 return DecodeError_clone(&*owner->contents.err);
10951 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10952 LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
10953 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10954 *ret_copy = CResult_InitDecodeErrorZ_get_err(owner_conv);
10955 int64_t ret_ref = tag_ptr(ret_copy, true);
10959 static inline struct LDKOpenChannel CResult_OpenChannelDecodeErrorZ_get_ok(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
10960 LDKOpenChannel ret = *owner->contents.result;
10961 ret.is_owned = false;
10964 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10965 LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
10966 LDKOpenChannel ret_var = CResult_OpenChannelDecodeErrorZ_get_ok(owner_conv);
10967 int64_t ret_ref = 0;
10968 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10969 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10973 static inline struct LDKDecodeError CResult_OpenChannelDecodeErrorZ_get_err(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
10974 CHECK(!owner->result_ok);
10975 return DecodeError_clone(&*owner->contents.err);
10977 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
10978 LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
10979 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
10980 *ret_copy = CResult_OpenChannelDecodeErrorZ_get_err(owner_conv);
10981 int64_t ret_ref = tag_ptr(ret_copy, true);
10985 static inline struct LDKRevokeAndACK CResult_RevokeAndACKDecodeErrorZ_get_ok(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
10986 LDKRevokeAndACK ret = *owner->contents.result;
10987 ret.is_owned = false;
10990 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
10991 LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
10992 LDKRevokeAndACK ret_var = CResult_RevokeAndACKDecodeErrorZ_get_ok(owner_conv);
10993 int64_t ret_ref = 0;
10994 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
10995 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
10999 static inline struct LDKDecodeError CResult_RevokeAndACKDecodeErrorZ_get_err(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
11000 CHECK(!owner->result_ok);
11001 return DecodeError_clone(&*owner->contents.err);
11003 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11004 LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
11005 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11006 *ret_copy = CResult_RevokeAndACKDecodeErrorZ_get_err(owner_conv);
11007 int64_t ret_ref = tag_ptr(ret_copy, true);
11011 static inline struct LDKShutdown CResult_ShutdownDecodeErrorZ_get_ok(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
11012 LDKShutdown ret = *owner->contents.result;
11013 ret.is_owned = false;
11016 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11017 LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
11018 LDKShutdown ret_var = CResult_ShutdownDecodeErrorZ_get_ok(owner_conv);
11019 int64_t ret_ref = 0;
11020 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11021 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11025 static inline struct LDKDecodeError CResult_ShutdownDecodeErrorZ_get_err(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
11026 CHECK(!owner->result_ok);
11027 return DecodeError_clone(&*owner->contents.err);
11029 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11030 LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
11031 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11032 *ret_copy = CResult_ShutdownDecodeErrorZ_get_err(owner_conv);
11033 int64_t ret_ref = tag_ptr(ret_copy, true);
11037 static inline struct LDKUpdateFailHTLC CResult_UpdateFailHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
11038 LDKUpdateFailHTLC ret = *owner->contents.result;
11039 ret.is_owned = false;
11042 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11043 LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
11044 LDKUpdateFailHTLC ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_ok(owner_conv);
11045 int64_t ret_ref = 0;
11046 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11047 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11051 static inline struct LDKDecodeError CResult_UpdateFailHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
11052 CHECK(!owner->result_ok);
11053 return DecodeError_clone(&*owner->contents.err);
11055 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11056 LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
11057 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11058 *ret_copy = CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner_conv);
11059 int64_t ret_ref = tag_ptr(ret_copy, true);
11063 static inline struct LDKUpdateFailMalformedHTLC CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
11064 LDKUpdateFailMalformedHTLC ret = *owner->contents.result;
11065 ret.is_owned = false;
11068 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11069 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
11070 LDKUpdateFailMalformedHTLC ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(owner_conv);
11071 int64_t ret_ref = 0;
11072 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11073 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11077 static inline struct LDKDecodeError CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
11078 CHECK(!owner->result_ok);
11079 return DecodeError_clone(&*owner->contents.err);
11081 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11082 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
11083 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11084 *ret_copy = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner_conv);
11085 int64_t ret_ref = tag_ptr(ret_copy, true);
11089 static inline struct LDKUpdateFee CResult_UpdateFeeDecodeErrorZ_get_ok(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
11090 LDKUpdateFee ret = *owner->contents.result;
11091 ret.is_owned = false;
11094 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11095 LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
11096 LDKUpdateFee ret_var = CResult_UpdateFeeDecodeErrorZ_get_ok(owner_conv);
11097 int64_t ret_ref = 0;
11098 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11099 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11103 static inline struct LDKDecodeError CResult_UpdateFeeDecodeErrorZ_get_err(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
11104 CHECK(!owner->result_ok);
11105 return DecodeError_clone(&*owner->contents.err);
11107 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11108 LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
11109 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11110 *ret_copy = CResult_UpdateFeeDecodeErrorZ_get_err(owner_conv);
11111 int64_t ret_ref = tag_ptr(ret_copy, true);
11115 static inline struct LDKUpdateFulfillHTLC CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
11116 LDKUpdateFulfillHTLC ret = *owner->contents.result;
11117 ret.is_owned = false;
11120 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11121 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
11122 LDKUpdateFulfillHTLC ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(owner_conv);
11123 int64_t ret_ref = 0;
11124 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11125 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11129 static inline struct LDKDecodeError CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
11130 CHECK(!owner->result_ok);
11131 return DecodeError_clone(&*owner->contents.err);
11133 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11134 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
11135 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11136 *ret_copy = CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner_conv);
11137 int64_t ret_ref = tag_ptr(ret_copy, true);
11141 static inline struct LDKUpdateAddHTLC CResult_UpdateAddHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
11142 LDKUpdateAddHTLC ret = *owner->contents.result;
11143 ret.is_owned = false;
11146 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11147 LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
11148 LDKUpdateAddHTLC ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_ok(owner_conv);
11149 int64_t ret_ref = 0;
11150 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11151 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11155 static inline struct LDKDecodeError CResult_UpdateAddHTLCDecodeErrorZ_get_err(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
11156 CHECK(!owner->result_ok);
11157 return DecodeError_clone(&*owner->contents.err);
11159 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11160 LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
11161 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11162 *ret_copy = CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner_conv);
11163 int64_t ret_ref = tag_ptr(ret_copy, true);
11167 static inline struct LDKOnionMessage CResult_OnionMessageDecodeErrorZ_get_ok(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR owner){
11168 LDKOnionMessage ret = *owner->contents.result;
11169 ret.is_owned = false;
11172 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11173 LDKCResult_OnionMessageDecodeErrorZ* owner_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(owner);
11174 LDKOnionMessage ret_var = CResult_OnionMessageDecodeErrorZ_get_ok(owner_conv);
11175 int64_t ret_ref = 0;
11176 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11177 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11181 static inline struct LDKDecodeError CResult_OnionMessageDecodeErrorZ_get_err(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR owner){
11182 CHECK(!owner->result_ok);
11183 return DecodeError_clone(&*owner->contents.err);
11185 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11186 LDKCResult_OnionMessageDecodeErrorZ* owner_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(owner);
11187 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11188 *ret_copy = CResult_OnionMessageDecodeErrorZ_get_err(owner_conv);
11189 int64_t ret_ref = tag_ptr(ret_copy, true);
11193 static inline struct LDKPing CResult_PingDecodeErrorZ_get_ok(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
11194 LDKPing ret = *owner->contents.result;
11195 ret.is_owned = false;
11198 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11199 LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
11200 LDKPing ret_var = CResult_PingDecodeErrorZ_get_ok(owner_conv);
11201 int64_t ret_ref = 0;
11202 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11203 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11207 static inline struct LDKDecodeError CResult_PingDecodeErrorZ_get_err(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
11208 CHECK(!owner->result_ok);
11209 return DecodeError_clone(&*owner->contents.err);
11211 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11212 LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
11213 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11214 *ret_copy = CResult_PingDecodeErrorZ_get_err(owner_conv);
11215 int64_t ret_ref = tag_ptr(ret_copy, true);
11219 static inline struct LDKPong CResult_PongDecodeErrorZ_get_ok(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
11220 LDKPong ret = *owner->contents.result;
11221 ret.is_owned = false;
11224 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11225 LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
11226 LDKPong ret_var = CResult_PongDecodeErrorZ_get_ok(owner_conv);
11227 int64_t ret_ref = 0;
11228 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11229 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11233 static inline struct LDKDecodeError CResult_PongDecodeErrorZ_get_err(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
11234 CHECK(!owner->result_ok);
11235 return DecodeError_clone(&*owner->contents.err);
11237 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11238 LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
11239 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11240 *ret_copy = CResult_PongDecodeErrorZ_get_err(owner_conv);
11241 int64_t ret_ref = tag_ptr(ret_copy, true);
11245 static inline struct LDKUnsignedChannelAnnouncement CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
11246 LDKUnsignedChannelAnnouncement ret = *owner->contents.result;
11247 ret.is_owned = false;
11250 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11251 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
11252 LDKUnsignedChannelAnnouncement ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(owner_conv);
11253 int64_t ret_ref = 0;
11254 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11255 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11259 static inline struct LDKDecodeError CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
11260 CHECK(!owner->result_ok);
11261 return DecodeError_clone(&*owner->contents.err);
11263 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11264 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
11265 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11266 *ret_copy = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
11267 int64_t ret_ref = tag_ptr(ret_copy, true);
11271 static inline struct LDKChannelAnnouncement CResult_ChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
11272 LDKChannelAnnouncement ret = *owner->contents.result;
11273 ret.is_owned = false;
11276 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11277 LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
11278 LDKChannelAnnouncement ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_ok(owner_conv);
11279 int64_t ret_ref = 0;
11280 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11281 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11285 static inline struct LDKDecodeError CResult_ChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
11286 CHECK(!owner->result_ok);
11287 return DecodeError_clone(&*owner->contents.err);
11289 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11290 LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
11291 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11292 *ret_copy = CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
11293 int64_t ret_ref = tag_ptr(ret_copy, true);
11297 static inline struct LDKUnsignedChannelUpdate CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
11298 LDKUnsignedChannelUpdate ret = *owner->contents.result;
11299 ret.is_owned = false;
11302 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11303 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
11304 LDKUnsignedChannelUpdate ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(owner_conv);
11305 int64_t ret_ref = 0;
11306 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11307 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11311 static inline struct LDKDecodeError CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
11312 CHECK(!owner->result_ok);
11313 return DecodeError_clone(&*owner->contents.err);
11315 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11316 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
11317 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11318 *ret_copy = CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner_conv);
11319 int64_t ret_ref = tag_ptr(ret_copy, true);
11323 static inline struct LDKChannelUpdate CResult_ChannelUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
11324 LDKChannelUpdate ret = *owner->contents.result;
11325 ret.is_owned = false;
11328 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11329 LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
11330 LDKChannelUpdate ret_var = CResult_ChannelUpdateDecodeErrorZ_get_ok(owner_conv);
11331 int64_t ret_ref = 0;
11332 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11333 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11337 static inline struct LDKDecodeError CResult_ChannelUpdateDecodeErrorZ_get_err(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
11338 CHECK(!owner->result_ok);
11339 return DecodeError_clone(&*owner->contents.err);
11341 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11342 LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
11343 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11344 *ret_copy = CResult_ChannelUpdateDecodeErrorZ_get_err(owner_conv);
11345 int64_t ret_ref = tag_ptr(ret_copy, true);
11349 static inline struct LDKErrorMessage CResult_ErrorMessageDecodeErrorZ_get_ok(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
11350 LDKErrorMessage ret = *owner->contents.result;
11351 ret.is_owned = false;
11354 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11355 LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
11356 LDKErrorMessage ret_var = CResult_ErrorMessageDecodeErrorZ_get_ok(owner_conv);
11357 int64_t ret_ref = 0;
11358 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11359 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11363 static inline struct LDKDecodeError CResult_ErrorMessageDecodeErrorZ_get_err(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
11364 CHECK(!owner->result_ok);
11365 return DecodeError_clone(&*owner->contents.err);
11367 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11368 LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
11369 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11370 *ret_copy = CResult_ErrorMessageDecodeErrorZ_get_err(owner_conv);
11371 int64_t ret_ref = tag_ptr(ret_copy, true);
11375 static inline struct LDKWarningMessage CResult_WarningMessageDecodeErrorZ_get_ok(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
11376 LDKWarningMessage ret = *owner->contents.result;
11377 ret.is_owned = false;
11380 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11381 LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
11382 LDKWarningMessage ret_var = CResult_WarningMessageDecodeErrorZ_get_ok(owner_conv);
11383 int64_t ret_ref = 0;
11384 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11385 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11389 static inline struct LDKDecodeError CResult_WarningMessageDecodeErrorZ_get_err(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
11390 CHECK(!owner->result_ok);
11391 return DecodeError_clone(&*owner->contents.err);
11393 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11394 LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
11395 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11396 *ret_copy = CResult_WarningMessageDecodeErrorZ_get_err(owner_conv);
11397 int64_t ret_ref = tag_ptr(ret_copy, true);
11401 static inline struct LDKUnsignedNodeAnnouncement CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
11402 LDKUnsignedNodeAnnouncement ret = *owner->contents.result;
11403 ret.is_owned = false;
11406 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11407 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
11408 LDKUnsignedNodeAnnouncement ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(owner_conv);
11409 int64_t ret_ref = 0;
11410 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11411 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11415 static inline struct LDKDecodeError CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
11416 CHECK(!owner->result_ok);
11417 return DecodeError_clone(&*owner->contents.err);
11419 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11420 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
11421 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11422 *ret_copy = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner_conv);
11423 int64_t ret_ref = tag_ptr(ret_copy, true);
11427 static inline struct LDKNodeAnnouncement CResult_NodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
11428 LDKNodeAnnouncement ret = *owner->contents.result;
11429 ret.is_owned = false;
11432 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11433 LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
11434 LDKNodeAnnouncement ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_ok(owner_conv);
11435 int64_t ret_ref = 0;
11436 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11437 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11441 static inline struct LDKDecodeError CResult_NodeAnnouncementDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
11442 CHECK(!owner->result_ok);
11443 return DecodeError_clone(&*owner->contents.err);
11445 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11446 LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
11447 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11448 *ret_copy = CResult_NodeAnnouncementDecodeErrorZ_get_err(owner_conv);
11449 int64_t ret_ref = tag_ptr(ret_copy, true);
11453 static inline struct LDKQueryShortChannelIds CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
11454 LDKQueryShortChannelIds ret = *owner->contents.result;
11455 ret.is_owned = false;
11458 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11459 LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
11460 LDKQueryShortChannelIds ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(owner_conv);
11461 int64_t ret_ref = 0;
11462 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11463 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11467 static inline struct LDKDecodeError CResult_QueryShortChannelIdsDecodeErrorZ_get_err(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
11468 CHECK(!owner->result_ok);
11469 return DecodeError_clone(&*owner->contents.err);
11471 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11472 LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
11473 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11474 *ret_copy = CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner_conv);
11475 int64_t ret_ref = tag_ptr(ret_copy, true);
11479 static inline struct LDKReplyShortChannelIdsEnd CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
11480 LDKReplyShortChannelIdsEnd ret = *owner->contents.result;
11481 ret.is_owned = false;
11484 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11485 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
11486 LDKReplyShortChannelIdsEnd ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(owner_conv);
11487 int64_t ret_ref = 0;
11488 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11489 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11493 static inline struct LDKDecodeError CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
11494 CHECK(!owner->result_ok);
11495 return DecodeError_clone(&*owner->contents.err);
11497 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11498 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
11499 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11500 *ret_copy = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner_conv);
11501 int64_t ret_ref = tag_ptr(ret_copy, true);
11505 static inline struct LDKQueryChannelRange CResult_QueryChannelRangeDecodeErrorZ_get_ok(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
11506 LDKQueryChannelRange ret = *owner->contents.result;
11507 ret.is_owned = false;
11510 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11511 LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
11512 LDKQueryChannelRange ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_ok(owner_conv);
11513 int64_t ret_ref = 0;
11514 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11515 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11519 static inline struct LDKDecodeError CResult_QueryChannelRangeDecodeErrorZ_get_err(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
11520 CHECK(!owner->result_ok);
11521 return DecodeError_clone(&*owner->contents.err);
11523 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11524 LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
11525 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11526 *ret_copy = CResult_QueryChannelRangeDecodeErrorZ_get_err(owner_conv);
11527 int64_t ret_ref = tag_ptr(ret_copy, true);
11531 static inline struct LDKReplyChannelRange CResult_ReplyChannelRangeDecodeErrorZ_get_ok(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
11532 LDKReplyChannelRange ret = *owner->contents.result;
11533 ret.is_owned = false;
11536 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11537 LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
11538 LDKReplyChannelRange ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_ok(owner_conv);
11539 int64_t ret_ref = 0;
11540 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11541 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11545 static inline struct LDKDecodeError CResult_ReplyChannelRangeDecodeErrorZ_get_err(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
11546 CHECK(!owner->result_ok);
11547 return DecodeError_clone(&*owner->contents.err);
11549 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11550 LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
11551 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11552 *ret_copy = CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner_conv);
11553 int64_t ret_ref = tag_ptr(ret_copy, true);
11557 static inline struct LDKGossipTimestampFilter CResult_GossipTimestampFilterDecodeErrorZ_get_ok(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
11558 LDKGossipTimestampFilter ret = *owner->contents.result;
11559 ret.is_owned = false;
11562 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11563 LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
11564 LDKGossipTimestampFilter ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_ok(owner_conv);
11565 int64_t ret_ref = 0;
11566 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11567 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11571 static inline struct LDKDecodeError CResult_GossipTimestampFilterDecodeErrorZ_get_err(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
11572 CHECK(!owner->result_ok);
11573 return DecodeError_clone(&*owner->contents.err);
11575 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11576 LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
11577 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
11578 *ret_copy = CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner_conv);
11579 int64_t ret_ref = tag_ptr(ret_copy, true);
11583 static inline LDKCVec_PhantomRouteHintsZ CVec_PhantomRouteHintsZ_clone(const LDKCVec_PhantomRouteHintsZ *orig) {
11584 LDKCVec_PhantomRouteHintsZ ret = { .data = MALLOC(sizeof(LDKPhantomRouteHints) * orig->datalen, "LDKCVec_PhantomRouteHintsZ clone bytes"), .datalen = orig->datalen };
11585 for (size_t i = 0; i < ret.datalen; i++) {
11586 ret.data[i] = PhantomRouteHints_clone(&orig->data[i]);
11590 static jclass LDKSignOrCreationError_SignError_class = NULL;
11591 static jmethodID LDKSignOrCreationError_SignError_meth = NULL;
11592 static jclass LDKSignOrCreationError_CreationError_class = NULL;
11593 static jmethodID LDKSignOrCreationError_CreationError_meth = NULL;
11594 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSignOrCreationError_init (JNIEnv *env, jclass clz) {
11595 LDKSignOrCreationError_SignError_class =
11596 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$SignError"));
11597 CHECK(LDKSignOrCreationError_SignError_class != NULL);
11598 LDKSignOrCreationError_SignError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_SignError_class, "<init>", "()V");
11599 CHECK(LDKSignOrCreationError_SignError_meth != NULL);
11600 LDKSignOrCreationError_CreationError_class =
11601 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSignOrCreationError$CreationError"));
11602 CHECK(LDKSignOrCreationError_CreationError_class != NULL);
11603 LDKSignOrCreationError_CreationError_meth = (*env)->GetMethodID(env, LDKSignOrCreationError_CreationError_class, "<init>", "(Lorg/ldk/enums/CreationError;)V");
11604 CHECK(LDKSignOrCreationError_CreationError_meth != NULL);
11606 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSignOrCreationError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
11607 LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr);
11609 case LDKSignOrCreationError_SignError: {
11610 return (*env)->NewObject(env, LDKSignOrCreationError_SignError_class, LDKSignOrCreationError_SignError_meth);
11612 case LDKSignOrCreationError_CreationError: {
11613 jclass creation_error_conv = LDKCreationError_to_java(env, obj->creation_error);
11614 return (*env)->NewObject(env, LDKSignOrCreationError_CreationError_class, LDKSignOrCreationError_CreationError_meth, creation_error_conv);
11619 static inline struct LDKInvoice CResult_InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){
11620 LDKInvoice ret = *owner->contents.result;
11621 ret.is_owned = false;
11624 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11625 LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner);
11626 LDKInvoice ret_var = CResult_InvoiceSignOrCreationErrorZ_get_ok(owner_conv);
11627 int64_t ret_ref = 0;
11628 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11629 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11633 static inline struct LDKSignOrCreationError CResult_InvoiceSignOrCreationErrorZ_get_err(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){
11634 CHECK(!owner->result_ok);
11635 return SignOrCreationError_clone(&*owner->contents.err);
11637 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11638 LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner);
11639 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
11640 *ret_copy = CResult_InvoiceSignOrCreationErrorZ_get_err(owner_conv);
11641 int64_t ret_ref = tag_ptr(ret_copy, true);
11645 static inline LDKCVec_FutureZ CVec_FutureZ_clone(const LDKCVec_FutureZ *orig) {
11646 LDKCVec_FutureZ ret = { .data = MALLOC(sizeof(LDKFuture) * orig->datalen, "LDKCVec_FutureZ clone bytes"), .datalen = orig->datalen };
11647 for (size_t i = 0; i < ret.datalen; i++) {
11648 ret.data[i] = Future_clone(&orig->data[i]);
11652 typedef struct LDKFilter_JCalls {
11653 atomic_size_t refcnt;
11656 jmethodID register_tx_meth;
11657 jmethodID register_output_meth;
11658 } LDKFilter_JCalls;
11659 static void LDKFilter_JCalls_free(void* this_arg) {
11660 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
11661 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
11663 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11664 if (get_jenv_res == JNI_EDETACHED) {
11665 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11667 DO_ASSERT(get_jenv_res == JNI_OK);
11669 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
11670 if (get_jenv_res == JNI_EDETACHED) {
11671 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11676 void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32], LDKu8slice script_pubkey) {
11677 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
11679 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11680 if (get_jenv_res == JNI_EDETACHED) {
11681 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11683 DO_ASSERT(get_jenv_res == JNI_OK);
11685 int8_tArray txid_arr = (*env)->NewByteArray(env, 32);
11686 (*env)->SetByteArrayRegion(env, txid_arr, 0, 32, *txid);
11687 LDKu8slice script_pubkey_var = script_pubkey;
11688 int8_tArray script_pubkey_arr = (*env)->NewByteArray(env, script_pubkey_var.datalen);
11689 (*env)->SetByteArrayRegion(env, script_pubkey_arr, 0, script_pubkey_var.datalen, script_pubkey_var.data);
11690 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11691 CHECK(obj != NULL);
11692 (*env)->CallVoidMethod(env, obj, j_calls->register_tx_meth, txid_arr, script_pubkey_arr);
11693 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11694 (*env)->ExceptionDescribe(env);
11695 (*env)->FatalError(env, "A call to register_tx in LDKFilter from rust threw an exception.");
11697 if (get_jenv_res == JNI_EDETACHED) {
11698 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11701 void register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) {
11702 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
11704 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11705 if (get_jenv_res == JNI_EDETACHED) {
11706 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11708 DO_ASSERT(get_jenv_res == JNI_OK);
11710 LDKWatchedOutput output_var = output;
11711 int64_t output_ref = 0;
11712 CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var);
11713 output_ref = tag_ptr(output_var.inner, output_var.is_owned);
11714 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11715 CHECK(obj != NULL);
11716 (*env)->CallVoidMethod(env, obj, j_calls->register_output_meth, output_ref);
11717 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11718 (*env)->ExceptionDescribe(env);
11719 (*env)->FatalError(env, "A call to register_output in LDKFilter from rust threw an exception.");
11721 if (get_jenv_res == JNI_EDETACHED) {
11722 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11725 static void LDKFilter_JCalls_cloned(LDKFilter* new_obj) {
11726 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) new_obj->this_arg;
11727 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
11729 static inline LDKFilter LDKFilter_init (JNIEnv *env, jclass clz, jobject o) {
11730 jclass c = (*env)->GetObjectClass(env, o);
11732 LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls");
11733 atomic_init(&calls->refcnt, 1);
11734 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
11735 calls->o = (*env)->NewWeakGlobalRef(env, o);
11736 calls->register_tx_meth = (*env)->GetMethodID(env, c, "register_tx", "([B[B)V");
11737 CHECK(calls->register_tx_meth != NULL);
11738 calls->register_output_meth = (*env)->GetMethodID(env, c, "register_output", "(J)V");
11739 CHECK(calls->register_output_meth != NULL);
11742 .this_arg = (void*) calls,
11743 .register_tx = register_tx_LDKFilter_jcall,
11744 .register_output = register_output_LDKFilter_jcall,
11745 .free = LDKFilter_JCalls_free,
11749 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKFilter_1new(JNIEnv *env, jclass clz, jobject o) {
11750 LDKFilter *res_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter");
11751 *res_ptr = LDKFilter_init(env, clz, o);
11752 return tag_ptr(res_ptr, true);
11754 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) {
11755 void* this_arg_ptr = untag_ptr(this_arg);
11756 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11757 LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
11758 uint8_t txid_arr[32];
11759 CHECK((*env)->GetArrayLength(env, txid) == 32);
11760 (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr);
11761 uint8_t (*txid_ref)[32] = &txid_arr;
11762 LDKu8slice script_pubkey_ref;
11763 script_pubkey_ref.datalen = (*env)->GetArrayLength(env, script_pubkey);
11764 script_pubkey_ref.data = (*env)->GetByteArrayElements (env, script_pubkey, NULL);
11765 (this_arg_conv->register_tx)(this_arg_conv->this_arg, txid_ref, script_pubkey_ref);
11766 (*env)->ReleaseByteArrayElements(env, script_pubkey, (int8_t*)script_pubkey_ref.data, 0);
11769 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output(JNIEnv *env, jclass clz, int64_t this_arg, int64_t output) {
11770 void* this_arg_ptr = untag_ptr(this_arg);
11771 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
11772 LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
11773 LDKWatchedOutput output_conv;
11774 output_conv.inner = untag_ptr(output);
11775 output_conv.is_owned = ptr_is_owned(output);
11776 CHECK_INNER_FIELD_ACCESS_OR_NULL(output_conv);
11777 output_conv = WatchedOutput_clone(&output_conv);
11778 (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv);
11781 static jclass LDKCOption_FilterZ_Some_class = NULL;
11782 static jmethodID LDKCOption_FilterZ_Some_meth = NULL;
11783 static jclass LDKCOption_FilterZ_None_class = NULL;
11784 static jmethodID LDKCOption_FilterZ_None_meth = NULL;
11785 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1FilterZ_init (JNIEnv *env, jclass clz) {
11786 LDKCOption_FilterZ_Some_class =
11787 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_FilterZ$Some"));
11788 CHECK(LDKCOption_FilterZ_Some_class != NULL);
11789 LDKCOption_FilterZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_FilterZ_Some_class, "<init>", "(J)V");
11790 CHECK(LDKCOption_FilterZ_Some_meth != NULL);
11791 LDKCOption_FilterZ_None_class =
11792 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_FilterZ$None"));
11793 CHECK(LDKCOption_FilterZ_None_class != NULL);
11794 LDKCOption_FilterZ_None_meth = (*env)->GetMethodID(env, LDKCOption_FilterZ_None_class, "<init>", "()V");
11795 CHECK(LDKCOption_FilterZ_None_meth != NULL);
11797 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1FilterZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
11798 LDKCOption_FilterZ *obj = (LDKCOption_FilterZ*)untag_ptr(ptr);
11800 case LDKCOption_FilterZ_Some: {
11801 LDKFilter* some_ret = MALLOC(sizeof(LDKFilter), "LDKFilter");
11802 *some_ret = obj->some;
11803 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
11804 if ((*some_ret).free == LDKFilter_JCalls_free) {
11805 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
11806 LDKFilter_JCalls_cloned(&(*some_ret));
11808 return (*env)->NewObject(env, LDKCOption_FilterZ_Some_class, LDKCOption_FilterZ_Some_meth, tag_ptr(some_ret, true));
11810 case LDKCOption_FilterZ_None: {
11811 return (*env)->NewObject(env, LDKCOption_FilterZ_None_class, LDKCOption_FilterZ_None_meth);
11816 static inline struct LDKLockedChannelMonitor CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){
11817 LDKLockedChannelMonitor ret = *owner->contents.result;
11818 ret.is_owned = false;
11821 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11822 LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner);
11823 LDKLockedChannelMonitor ret_var = CResult_LockedChannelMonitorNoneZ_get_ok(owner_conv);
11824 int64_t ret_ref = 0;
11825 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11826 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11830 static inline void CResult_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){
11831 CHECK(!owner->result_ok);
11832 return *owner->contents.err;
11834 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11835 LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner);
11836 CResult_LockedChannelMonitorNoneZ_get_err(owner_conv);
11839 static inline LDKCVec_OutPointZ CVec_OutPointZ_clone(const LDKCVec_OutPointZ *orig) {
11840 LDKCVec_OutPointZ ret = { .data = MALLOC(sizeof(LDKOutPoint) * orig->datalen, "LDKCVec_OutPointZ clone bytes"), .datalen = orig->datalen };
11841 for (size_t i = 0; i < ret.datalen; i++) {
11842 ret.data[i] = OutPoint_clone(&orig->data[i]);
11846 static inline LDKCVec_MonitorUpdateIdZ CVec_MonitorUpdateIdZ_clone(const LDKCVec_MonitorUpdateIdZ *orig) {
11847 LDKCVec_MonitorUpdateIdZ ret = { .data = MALLOC(sizeof(LDKMonitorUpdateId) * orig->datalen, "LDKCVec_MonitorUpdateIdZ clone bytes"), .datalen = orig->datalen };
11848 for (size_t i = 0; i < ret.datalen; i++) {
11849 ret.data[i] = MonitorUpdateId_clone(&orig->data[i]);
11853 static inline struct LDKOutPoint C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){
11854 LDKOutPoint ret = owner->a;
11855 ret.is_owned = false;
11858 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) {
11859 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner);
11860 LDKOutPoint ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(owner_conv);
11861 int64_t ret_ref = 0;
11862 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
11863 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
11867 static inline struct LDKCVec_MonitorUpdateIdZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){
11868 return CVec_MonitorUpdateIdZ_clone(&owner->b);
11870 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) {
11871 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner);
11872 LDKCVec_MonitorUpdateIdZ ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(owner_conv);
11873 int64_tArray ret_arr = NULL;
11874 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
11875 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
11876 for (size_t r = 0; r < ret_var.datalen; r++) {
11877 LDKMonitorUpdateId ret_conv_17_var = ret_var.data[r];
11878 int64_t ret_conv_17_ref = 0;
11879 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_17_var);
11880 ret_conv_17_ref = tag_ptr(ret_conv_17_var.inner, ret_conv_17_var.is_owned);
11881 ret_arr_ptr[r] = ret_conv_17_ref;
11883 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
11884 FREE(ret_var.data);
11888 static inline LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_clone(const LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ *orig) {
11889 LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ clone bytes"), .datalen = orig->datalen };
11890 for (size_t i = 0; i < ret.datalen; i++) {
11891 ret.data[i] = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(&orig->data[i]);
11895 static jclass LDKGraphSyncError_DecodeError_class = NULL;
11896 static jmethodID LDKGraphSyncError_DecodeError_meth = NULL;
11897 static jclass LDKGraphSyncError_LightningError_class = NULL;
11898 static jmethodID LDKGraphSyncError_LightningError_meth = NULL;
11899 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKGraphSyncError_init (JNIEnv *env, jclass clz) {
11900 LDKGraphSyncError_DecodeError_class =
11901 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGraphSyncError$DecodeError"));
11902 CHECK(LDKGraphSyncError_DecodeError_class != NULL);
11903 LDKGraphSyncError_DecodeError_meth = (*env)->GetMethodID(env, LDKGraphSyncError_DecodeError_class, "<init>", "(J)V");
11904 CHECK(LDKGraphSyncError_DecodeError_meth != NULL);
11905 LDKGraphSyncError_LightningError_class =
11906 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGraphSyncError$LightningError"));
11907 CHECK(LDKGraphSyncError_LightningError_class != NULL);
11908 LDKGraphSyncError_LightningError_meth = (*env)->GetMethodID(env, LDKGraphSyncError_LightningError_class, "<init>", "(J)V");
11909 CHECK(LDKGraphSyncError_LightningError_meth != NULL);
11911 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKGraphSyncError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
11912 LDKGraphSyncError *obj = (LDKGraphSyncError*)untag_ptr(ptr);
11914 case LDKGraphSyncError_DecodeError: {
11915 int64_t decode_error_ref = tag_ptr(&obj->decode_error, false);
11916 return (*env)->NewObject(env, LDKGraphSyncError_DecodeError_class, LDKGraphSyncError_DecodeError_meth, decode_error_ref);
11918 case LDKGraphSyncError_LightningError: {
11919 LDKLightningError lightning_error_var = obj->lightning_error;
11920 int64_t lightning_error_ref = 0;
11921 CHECK_INNER_FIELD_ACCESS_OR_NULL(lightning_error_var);
11922 lightning_error_ref = tag_ptr(lightning_error_var.inner, false);
11923 return (*env)->NewObject(env, LDKGraphSyncError_LightningError_class, LDKGraphSyncError_LightningError_meth, lightning_error_ref);
11928 static inline uint32_t CResult_u32GraphSyncErrorZ_get_ok(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){
11929 CHECK(owner->result_ok);
11930 return *owner->contents.result;
11932 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
11933 LDKCResult_u32GraphSyncErrorZ* owner_conv = (LDKCResult_u32GraphSyncErrorZ*)untag_ptr(owner);
11934 int32_t ret_conv = CResult_u32GraphSyncErrorZ_get_ok(owner_conv);
11938 static inline struct LDKGraphSyncError CResult_u32GraphSyncErrorZ_get_err(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){
11939 CHECK(!owner->result_ok);
11940 return GraphSyncError_clone(&*owner->contents.err);
11942 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
11943 LDKCResult_u32GraphSyncErrorZ* owner_conv = (LDKCResult_u32GraphSyncErrorZ*)untag_ptr(owner);
11944 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
11945 *ret_copy = CResult_u32GraphSyncErrorZ_get_err(owner_conv);
11946 int64_t ret_ref = tag_ptr(ret_copy, true);
11950 typedef struct LDKPersister_JCalls {
11951 atomic_size_t refcnt;
11954 jmethodID persist_manager_meth;
11955 jmethodID persist_graph_meth;
11956 jmethodID persist_scorer_meth;
11957 } LDKPersister_JCalls;
11958 static void LDKPersister_JCalls_free(void* this_arg) {
11959 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
11960 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
11962 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11963 if (get_jenv_res == JNI_EDETACHED) {
11964 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11966 DO_ASSERT(get_jenv_res == JNI_OK);
11968 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
11969 if (get_jenv_res == JNI_EDETACHED) {
11970 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
11975 LDKCResult_NoneErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, const LDKChannelManager * channel_manager) {
11976 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
11978 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
11979 if (get_jenv_res == JNI_EDETACHED) {
11980 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
11982 DO_ASSERT(get_jenv_res == JNI_OK);
11984 LDKChannelManager channel_manager_var = *channel_manager;
11985 int64_t channel_manager_ref = 0;
11986 // WARNING: we may need a move here but no clone is available for LDKChannelManager
11987 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var);
11988 channel_manager_ref = tag_ptr(channel_manager_var.inner, channel_manager_var.is_owned);
11989 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
11990 CHECK(obj != NULL);
11991 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_manager_meth, channel_manager_ref);
11992 if (UNLIKELY((*env)->ExceptionCheck(env))) {
11993 (*env)->ExceptionDescribe(env);
11994 (*env)->FatalError(env, "A call to persist_manager in LDKPersister from rust threw an exception.");
11996 void* ret_ptr = untag_ptr(ret);
11997 CHECK_ACCESS(ret_ptr);
11998 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
11999 FREE(untag_ptr(ret));
12000 if (get_jenv_res == JNI_EDETACHED) {
12001 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12005 LDKCResult_NoneErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, const LDKNetworkGraph * network_graph) {
12006 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
12008 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12009 if (get_jenv_res == JNI_EDETACHED) {
12010 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12012 DO_ASSERT(get_jenv_res == JNI_OK);
12014 LDKNetworkGraph network_graph_var = *network_graph;
12015 int64_t network_graph_ref = 0;
12016 // WARNING: we may need a move here but no clone is available for LDKNetworkGraph
12017 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_var);
12018 network_graph_ref = tag_ptr(network_graph_var.inner, network_graph_var.is_owned);
12019 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12020 CHECK(obj != NULL);
12021 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_graph_meth, network_graph_ref);
12022 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12023 (*env)->ExceptionDescribe(env);
12024 (*env)->FatalError(env, "A call to persist_graph in LDKPersister from rust threw an exception.");
12026 void* ret_ptr = untag_ptr(ret);
12027 CHECK_ACCESS(ret_ptr);
12028 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
12029 FREE(untag_ptr(ret));
12030 if (get_jenv_res == JNI_EDETACHED) {
12031 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12035 LDKCResult_NoneErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, const LDKWriteableScore * scorer) {
12036 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
12038 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12039 if (get_jenv_res == JNI_EDETACHED) {
12040 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12042 DO_ASSERT(get_jenv_res == JNI_OK);
12044 // WARNING: This object doesn't live past this scope, needs clone!
12045 int64_t ret_scorer = tag_ptr(scorer, false);
12046 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12047 CHECK(obj != NULL);
12048 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_scorer_meth, ret_scorer);
12049 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12050 (*env)->ExceptionDescribe(env);
12051 (*env)->FatalError(env, "A call to persist_scorer in LDKPersister from rust threw an exception.");
12053 void* ret_ptr = untag_ptr(ret);
12054 CHECK_ACCESS(ret_ptr);
12055 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
12056 FREE(untag_ptr(ret));
12057 if (get_jenv_res == JNI_EDETACHED) {
12058 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12062 static void LDKPersister_JCalls_cloned(LDKPersister* new_obj) {
12063 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) new_obj->this_arg;
12064 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
12066 static inline LDKPersister LDKPersister_init (JNIEnv *env, jclass clz, jobject o) {
12067 jclass c = (*env)->GetObjectClass(env, o);
12069 LDKPersister_JCalls *calls = MALLOC(sizeof(LDKPersister_JCalls), "LDKPersister_JCalls");
12070 atomic_init(&calls->refcnt, 1);
12071 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
12072 calls->o = (*env)->NewWeakGlobalRef(env, o);
12073 calls->persist_manager_meth = (*env)->GetMethodID(env, c, "persist_manager", "(J)J");
12074 CHECK(calls->persist_manager_meth != NULL);
12075 calls->persist_graph_meth = (*env)->GetMethodID(env, c, "persist_graph", "(J)J");
12076 CHECK(calls->persist_graph_meth != NULL);
12077 calls->persist_scorer_meth = (*env)->GetMethodID(env, c, "persist_scorer", "(J)J");
12078 CHECK(calls->persist_scorer_meth != NULL);
12080 LDKPersister ret = {
12081 .this_arg = (void*) calls,
12082 .persist_manager = persist_manager_LDKPersister_jcall,
12083 .persist_graph = persist_graph_LDKPersister_jcall,
12084 .persist_scorer = persist_scorer_LDKPersister_jcall,
12085 .free = LDKPersister_JCalls_free,
12089 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPersister_1new(JNIEnv *env, jclass clz, jobject o) {
12090 LDKPersister *res_ptr = MALLOC(sizeof(LDKPersister), "LDKPersister");
12091 *res_ptr = LDKPersister_init(env, clz, o);
12092 return tag_ptr(res_ptr, true);
12094 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1manager(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_manager) {
12095 void* this_arg_ptr = untag_ptr(this_arg);
12096 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12097 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
12098 LDKChannelManager channel_manager_conv;
12099 channel_manager_conv.inner = untag_ptr(channel_manager);
12100 channel_manager_conv.is_owned = ptr_is_owned(channel_manager);
12101 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv);
12102 channel_manager_conv.is_owned = false;
12103 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
12104 *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv);
12105 return tag_ptr(ret_conv, true);
12108 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1graph(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_graph) {
12109 void* this_arg_ptr = untag_ptr(this_arg);
12110 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12111 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
12112 LDKNetworkGraph network_graph_conv;
12113 network_graph_conv.inner = untag_ptr(network_graph);
12114 network_graph_conv.is_owned = ptr_is_owned(network_graph);
12115 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
12116 network_graph_conv.is_owned = false;
12117 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
12118 *ret_conv = (this_arg_conv->persist_graph)(this_arg_conv->this_arg, &network_graph_conv);
12119 return tag_ptr(ret_conv, true);
12122 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persister_1persist_1scorer(JNIEnv *env, jclass clz, int64_t this_arg, int64_t scorer) {
12123 void* this_arg_ptr = untag_ptr(this_arg);
12124 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12125 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
12126 void* scorer_ptr = untag_ptr(scorer);
12127 if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
12128 LDKWriteableScore* scorer_conv = (LDKWriteableScore*)scorer_ptr;
12129 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
12130 *ret_conv = (this_arg_conv->persist_scorer)(this_arg_conv->this_arg, scorer_conv);
12131 return tag_ptr(ret_conv, true);
12134 typedef struct LDKFutureCallback_JCalls {
12135 atomic_size_t refcnt;
12138 jmethodID call_meth;
12139 } LDKFutureCallback_JCalls;
12140 static void LDKFutureCallback_JCalls_free(void* this_arg) {
12141 LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg;
12142 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
12144 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12145 if (get_jenv_res == JNI_EDETACHED) {
12146 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12148 DO_ASSERT(get_jenv_res == JNI_OK);
12150 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
12151 if (get_jenv_res == JNI_EDETACHED) {
12152 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12157 void call_LDKFutureCallback_jcall(const void* this_arg) {
12158 LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg;
12160 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12161 if (get_jenv_res == JNI_EDETACHED) {
12162 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12164 DO_ASSERT(get_jenv_res == JNI_OK);
12166 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12167 CHECK(obj != NULL);
12168 (*env)->CallVoidMethod(env, obj, j_calls->call_meth);
12169 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12170 (*env)->ExceptionDescribe(env);
12171 (*env)->FatalError(env, "A call to call in LDKFutureCallback from rust threw an exception.");
12173 if (get_jenv_res == JNI_EDETACHED) {
12174 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12177 static void LDKFutureCallback_JCalls_cloned(LDKFutureCallback* new_obj) {
12178 LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) new_obj->this_arg;
12179 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
12181 static inline LDKFutureCallback LDKFutureCallback_init (JNIEnv *env, jclass clz, jobject o) {
12182 jclass c = (*env)->GetObjectClass(env, o);
12184 LDKFutureCallback_JCalls *calls = MALLOC(sizeof(LDKFutureCallback_JCalls), "LDKFutureCallback_JCalls");
12185 atomic_init(&calls->refcnt, 1);
12186 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
12187 calls->o = (*env)->NewWeakGlobalRef(env, o);
12188 calls->call_meth = (*env)->GetMethodID(env, c, "call", "()V");
12189 CHECK(calls->call_meth != NULL);
12191 LDKFutureCallback ret = {
12192 .this_arg = (void*) calls,
12193 .call = call_LDKFutureCallback_jcall,
12194 .free = LDKFutureCallback_JCalls_free,
12198 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKFutureCallback_1new(JNIEnv *env, jclass clz, jobject o) {
12199 LDKFutureCallback *res_ptr = MALLOC(sizeof(LDKFutureCallback), "LDKFutureCallback");
12200 *res_ptr = LDKFutureCallback_init(env, clz, o);
12201 return tag_ptr(res_ptr, true);
12203 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FutureCallback_1call(JNIEnv *env, jclass clz, int64_t this_arg) {
12204 void* this_arg_ptr = untag_ptr(this_arg);
12205 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12206 LDKFutureCallback* this_arg_conv = (LDKFutureCallback*)this_arg_ptr;
12207 (this_arg_conv->call)(this_arg_conv->this_arg);
12210 typedef struct LDKListen_JCalls {
12211 atomic_size_t refcnt;
12214 jmethodID filtered_block_connected_meth;
12215 jmethodID block_connected_meth;
12216 jmethodID block_disconnected_meth;
12217 } LDKListen_JCalls;
12218 static void LDKListen_JCalls_free(void* this_arg) {
12219 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
12220 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
12222 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12223 if (get_jenv_res == JNI_EDETACHED) {
12224 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12226 DO_ASSERT(get_jenv_res == JNI_OK);
12228 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
12229 if (get_jenv_res == JNI_EDETACHED) {
12230 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12235 void filtered_block_connected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) {
12236 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
12238 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12239 if (get_jenv_res == JNI_EDETACHED) {
12240 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12242 DO_ASSERT(get_jenv_res == JNI_OK);
12244 int8_tArray header_arr = (*env)->NewByteArray(env, 80);
12245 (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header);
12246 LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
12247 int64_tArray txdata_arr = NULL;
12248 txdata_arr = (*env)->NewLongArray(env, txdata_var.datalen);
12249 int64_t *txdata_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, txdata_arr, NULL);
12250 for (size_t c = 0; c < txdata_var.datalen; c++) {
12251 LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
12252 *txdata_conv_28_conv = txdata_var.data[c];
12253 txdata_arr_ptr[c] = tag_ptr(txdata_conv_28_conv, true);
12255 (*env)->ReleasePrimitiveArrayCritical(env, txdata_arr, txdata_arr_ptr, 0);
12256 FREE(txdata_var.data);
12257 int32_t height_conv = height;
12258 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12259 CHECK(obj != NULL);
12260 (*env)->CallVoidMethod(env, obj, j_calls->filtered_block_connected_meth, header_arr, txdata_arr, height_conv);
12261 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12262 (*env)->ExceptionDescribe(env);
12263 (*env)->FatalError(env, "A call to filtered_block_connected in LDKListen from rust threw an exception.");
12265 if (get_jenv_res == JNI_EDETACHED) {
12266 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12269 void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) {
12270 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
12272 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12273 if (get_jenv_res == JNI_EDETACHED) {
12274 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12276 DO_ASSERT(get_jenv_res == JNI_OK);
12278 LDKu8slice block_var = block;
12279 int8_tArray block_arr = (*env)->NewByteArray(env, block_var.datalen);
12280 (*env)->SetByteArrayRegion(env, block_arr, 0, block_var.datalen, block_var.data);
12281 int32_t height_conv = height;
12282 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12283 CHECK(obj != NULL);
12284 (*env)->CallVoidMethod(env, obj, j_calls->block_connected_meth, block_arr, height_conv);
12285 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12286 (*env)->ExceptionDescribe(env);
12287 (*env)->FatalError(env, "A call to block_connected in LDKListen from rust threw an exception.");
12289 if (get_jenv_res == JNI_EDETACHED) {
12290 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12293 void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
12294 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
12296 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12297 if (get_jenv_res == JNI_EDETACHED) {
12298 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12300 DO_ASSERT(get_jenv_res == JNI_OK);
12302 int8_tArray header_arr = (*env)->NewByteArray(env, 80);
12303 (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header);
12304 int32_t height_conv = height;
12305 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12306 CHECK(obj != NULL);
12307 (*env)->CallVoidMethod(env, obj, j_calls->block_disconnected_meth, header_arr, height_conv);
12308 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12309 (*env)->ExceptionDescribe(env);
12310 (*env)->FatalError(env, "A call to block_disconnected in LDKListen from rust threw an exception.");
12312 if (get_jenv_res == JNI_EDETACHED) {
12313 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12316 static void LDKListen_JCalls_cloned(LDKListen* new_obj) {
12317 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg;
12318 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
12320 static inline LDKListen LDKListen_init (JNIEnv *env, jclass clz, jobject o) {
12321 jclass c = (*env)->GetObjectClass(env, o);
12323 LDKListen_JCalls *calls = MALLOC(sizeof(LDKListen_JCalls), "LDKListen_JCalls");
12324 atomic_init(&calls->refcnt, 1);
12325 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
12326 calls->o = (*env)->NewWeakGlobalRef(env, o);
12327 calls->filtered_block_connected_meth = (*env)->GetMethodID(env, c, "filtered_block_connected", "([B[JI)V");
12328 CHECK(calls->filtered_block_connected_meth != NULL);
12329 calls->block_connected_meth = (*env)->GetMethodID(env, c, "block_connected", "([BI)V");
12330 CHECK(calls->block_connected_meth != NULL);
12331 calls->block_disconnected_meth = (*env)->GetMethodID(env, c, "block_disconnected", "([BI)V");
12332 CHECK(calls->block_disconnected_meth != NULL);
12335 .this_arg = (void*) calls,
12336 .filtered_block_connected = filtered_block_connected_LDKListen_jcall,
12337 .block_connected = block_connected_LDKListen_jcall,
12338 .block_disconnected = block_disconnected_LDKListen_jcall,
12339 .free = LDKListen_JCalls_free,
12343 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKListen_1new(JNIEnv *env, jclass clz, jobject o) {
12344 LDKListen *res_ptr = MALLOC(sizeof(LDKListen), "LDKListen");
12345 *res_ptr = LDKListen_init(env, clz, o);
12346 return tag_ptr(res_ptr, true);
12348 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) {
12349 void* this_arg_ptr = untag_ptr(this_arg);
12350 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12351 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
12352 uint8_t header_arr[80];
12353 CHECK((*env)->GetArrayLength(env, header) == 80);
12354 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
12355 uint8_t (*header_ref)[80] = &header_arr;
12356 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
12357 txdata_constr.datalen = (*env)->GetArrayLength(env, txdata);
12358 if (txdata_constr.datalen > 0)
12359 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
12361 txdata_constr.data = NULL;
12362 int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
12363 for (size_t c = 0; c < txdata_constr.datalen; c++) {
12364 int64_t txdata_conv_28 = txdata_vals[c];
12365 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
12366 CHECK_ACCESS(txdata_conv_28_ptr);
12367 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
12368 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
12369 txdata_constr.data[c] = txdata_conv_28_conv;
12371 (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
12372 (this_arg_conv->filtered_block_connected)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
12375 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) {
12376 void* this_arg_ptr = untag_ptr(this_arg);
12377 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12378 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
12379 LDKu8slice block_ref;
12380 block_ref.datalen = (*env)->GetArrayLength(env, block);
12381 block_ref.data = (*env)->GetByteArrayElements (env, block, NULL);
12382 (this_arg_conv->block_connected)(this_arg_conv->this_arg, block_ref, height);
12383 (*env)->ReleaseByteArrayElements(env, block, (int8_t*)block_ref.data, 0);
12386 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) {
12387 void* this_arg_ptr = untag_ptr(this_arg);
12388 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12389 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
12390 uint8_t header_arr[80];
12391 CHECK((*env)->GetArrayLength(env, header) == 80);
12392 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
12393 uint8_t (*header_ref)[80] = &header_arr;
12394 (this_arg_conv->block_disconnected)(this_arg_conv->this_arg, header_ref, height);
12397 typedef struct LDKConfirm_JCalls {
12398 atomic_size_t refcnt;
12401 jmethodID transactions_confirmed_meth;
12402 jmethodID transaction_unconfirmed_meth;
12403 jmethodID best_block_updated_meth;
12404 jmethodID get_relevant_txids_meth;
12405 } LDKConfirm_JCalls;
12406 static void LDKConfirm_JCalls_free(void* this_arg) {
12407 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
12408 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
12410 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12411 if (get_jenv_res == JNI_EDETACHED) {
12412 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12414 DO_ASSERT(get_jenv_res == JNI_OK);
12416 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
12417 if (get_jenv_res == JNI_EDETACHED) {
12418 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12423 void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) {
12424 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
12426 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12427 if (get_jenv_res == JNI_EDETACHED) {
12428 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12430 DO_ASSERT(get_jenv_res == JNI_OK);
12432 int8_tArray header_arr = (*env)->NewByteArray(env, 80);
12433 (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header);
12434 LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
12435 int64_tArray txdata_arr = NULL;
12436 txdata_arr = (*env)->NewLongArray(env, txdata_var.datalen);
12437 int64_t *txdata_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, txdata_arr, NULL);
12438 for (size_t c = 0; c < txdata_var.datalen; c++) {
12439 LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
12440 *txdata_conv_28_conv = txdata_var.data[c];
12441 txdata_arr_ptr[c] = tag_ptr(txdata_conv_28_conv, true);
12443 (*env)->ReleasePrimitiveArrayCritical(env, txdata_arr, txdata_arr_ptr, 0);
12444 FREE(txdata_var.data);
12445 int32_t height_conv = height;
12446 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12447 CHECK(obj != NULL);
12448 (*env)->CallVoidMethod(env, obj, j_calls->transactions_confirmed_meth, header_arr, txdata_arr, height_conv);
12449 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12450 (*env)->ExceptionDescribe(env);
12451 (*env)->FatalError(env, "A call to transactions_confirmed in LDKConfirm from rust threw an exception.");
12453 if (get_jenv_res == JNI_EDETACHED) {
12454 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12457 void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) {
12458 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
12460 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12461 if (get_jenv_res == JNI_EDETACHED) {
12462 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12464 DO_ASSERT(get_jenv_res == JNI_OK);
12466 int8_tArray txid_arr = (*env)->NewByteArray(env, 32);
12467 (*env)->SetByteArrayRegion(env, txid_arr, 0, 32, *txid);
12468 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12469 CHECK(obj != NULL);
12470 (*env)->CallVoidMethod(env, obj, j_calls->transaction_unconfirmed_meth, txid_arr);
12471 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12472 (*env)->ExceptionDescribe(env);
12473 (*env)->FatalError(env, "A call to transaction_unconfirmed in LDKConfirm from rust threw an exception.");
12475 if (get_jenv_res == JNI_EDETACHED) {
12476 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12479 void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
12480 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
12482 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12483 if (get_jenv_res == JNI_EDETACHED) {
12484 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12486 DO_ASSERT(get_jenv_res == JNI_OK);
12488 int8_tArray header_arr = (*env)->NewByteArray(env, 80);
12489 (*env)->SetByteArrayRegion(env, header_arr, 0, 80, *header);
12490 int32_t height_conv = height;
12491 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12492 CHECK(obj != NULL);
12493 (*env)->CallVoidMethod(env, obj, j_calls->best_block_updated_meth, header_arr, height_conv);
12494 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12495 (*env)->ExceptionDescribe(env);
12496 (*env)->FatalError(env, "A call to best_block_updated in LDKConfirm from rust threw an exception.");
12498 if (get_jenv_res == JNI_EDETACHED) {
12499 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12502 LDKCVec_C2Tuple_TxidBlockHashZZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) {
12503 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
12505 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12506 if (get_jenv_res == JNI_EDETACHED) {
12507 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12509 DO_ASSERT(get_jenv_res == JNI_OK);
12511 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12512 CHECK(obj != NULL);
12513 int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_relevant_txids_meth);
12514 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12515 (*env)->ExceptionDescribe(env);
12516 (*env)->FatalError(env, "A call to get_relevant_txids in LDKConfirm from rust threw an exception.");
12518 LDKCVec_C2Tuple_TxidBlockHashZZ ret_constr;
12519 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
12520 if (ret_constr.datalen > 0)
12521 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKCVec_C2Tuple_TxidBlockHashZZ Elements");
12523 ret_constr.data = NULL;
12524 int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
12525 for (size_t z = 0; z < ret_constr.datalen; z++) {
12526 int64_t ret_conv_25 = ret_vals[z];
12527 void* ret_conv_25_ptr = untag_ptr(ret_conv_25);
12528 CHECK_ACCESS(ret_conv_25_ptr);
12529 LDKC2Tuple_TxidBlockHashZ ret_conv_25_conv = *(LDKC2Tuple_TxidBlockHashZ*)(ret_conv_25_ptr);
12530 FREE(untag_ptr(ret_conv_25));
12531 ret_constr.data[z] = ret_conv_25_conv;
12533 (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
12534 if (get_jenv_res == JNI_EDETACHED) {
12535 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12539 static void LDKConfirm_JCalls_cloned(LDKConfirm* new_obj) {
12540 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) new_obj->this_arg;
12541 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
12543 static inline LDKConfirm LDKConfirm_init (JNIEnv *env, jclass clz, jobject o) {
12544 jclass c = (*env)->GetObjectClass(env, o);
12546 LDKConfirm_JCalls *calls = MALLOC(sizeof(LDKConfirm_JCalls), "LDKConfirm_JCalls");
12547 atomic_init(&calls->refcnt, 1);
12548 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
12549 calls->o = (*env)->NewWeakGlobalRef(env, o);
12550 calls->transactions_confirmed_meth = (*env)->GetMethodID(env, c, "transactions_confirmed", "([B[JI)V");
12551 CHECK(calls->transactions_confirmed_meth != NULL);
12552 calls->transaction_unconfirmed_meth = (*env)->GetMethodID(env, c, "transaction_unconfirmed", "([B)V");
12553 CHECK(calls->transaction_unconfirmed_meth != NULL);
12554 calls->best_block_updated_meth = (*env)->GetMethodID(env, c, "best_block_updated", "([BI)V");
12555 CHECK(calls->best_block_updated_meth != NULL);
12556 calls->get_relevant_txids_meth = (*env)->GetMethodID(env, c, "get_relevant_txids", "()[J");
12557 CHECK(calls->get_relevant_txids_meth != NULL);
12560 .this_arg = (void*) calls,
12561 .transactions_confirmed = transactions_confirmed_LDKConfirm_jcall,
12562 .transaction_unconfirmed = transaction_unconfirmed_LDKConfirm_jcall,
12563 .best_block_updated = best_block_updated_LDKConfirm_jcall,
12564 .get_relevant_txids = get_relevant_txids_LDKConfirm_jcall,
12565 .free = LDKConfirm_JCalls_free,
12569 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKConfirm_1new(JNIEnv *env, jclass clz, jobject o) {
12570 LDKConfirm *res_ptr = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
12571 *res_ptr = LDKConfirm_init(env, clz, o);
12572 return tag_ptr(res_ptr, true);
12574 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) {
12575 void* this_arg_ptr = untag_ptr(this_arg);
12576 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12577 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
12578 uint8_t header_arr[80];
12579 CHECK((*env)->GetArrayLength(env, header) == 80);
12580 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
12581 uint8_t (*header_ref)[80] = &header_arr;
12582 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
12583 txdata_constr.datalen = (*env)->GetArrayLength(env, txdata);
12584 if (txdata_constr.datalen > 0)
12585 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
12587 txdata_constr.data = NULL;
12588 int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
12589 for (size_t c = 0; c < txdata_constr.datalen; c++) {
12590 int64_t txdata_conv_28 = txdata_vals[c];
12591 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
12592 CHECK_ACCESS(txdata_conv_28_ptr);
12593 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
12594 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
12595 txdata_constr.data[c] = txdata_conv_28_conv;
12597 (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
12598 (this_arg_conv->transactions_confirmed)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
12601 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1transaction_1unconfirmed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid) {
12602 void* this_arg_ptr = untag_ptr(this_arg);
12603 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12604 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
12605 uint8_t txid_arr[32];
12606 CHECK((*env)->GetArrayLength(env, txid) == 32);
12607 (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr);
12608 uint8_t (*txid_ref)[32] = &txid_arr;
12609 (this_arg_conv->transaction_unconfirmed)(this_arg_conv->this_arg, txid_ref);
12612 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) {
12613 void* this_arg_ptr = untag_ptr(this_arg);
12614 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12615 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
12616 uint8_t header_arr[80];
12617 CHECK((*env)->GetArrayLength(env, header) == 80);
12618 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
12619 uint8_t (*header_ref)[80] = &header_arr;
12620 (this_arg_conv->best_block_updated)(this_arg_conv->this_arg, header_ref, height);
12623 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Confirm_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) {
12624 void* this_arg_ptr = untag_ptr(this_arg);
12625 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12626 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
12627 LDKCVec_C2Tuple_TxidBlockHashZZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg);
12628 int64_tArray ret_arr = NULL;
12629 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
12630 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
12631 for (size_t z = 0; z < ret_var.datalen; z++) {
12632 LDKC2Tuple_TxidBlockHashZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ");
12633 *ret_conv_25_conv = ret_var.data[z];
12634 ret_arr_ptr[z] = tag_ptr(ret_conv_25_conv, true);
12636 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
12637 FREE(ret_var.data);
12641 typedef struct LDKPersist_JCalls {
12642 atomic_size_t refcnt;
12645 jmethodID persist_new_channel_meth;
12646 jmethodID update_persisted_channel_meth;
12647 } LDKPersist_JCalls;
12648 static void LDKPersist_JCalls_free(void* this_arg) {
12649 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
12650 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
12652 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12653 if (get_jenv_res == JNI_EDETACHED) {
12654 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12656 DO_ASSERT(get_jenv_res == JNI_OK);
12658 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
12659 if (get_jenv_res == JNI_EDETACHED) {
12660 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12665 LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
12666 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
12668 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12669 if (get_jenv_res == JNI_EDETACHED) {
12670 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12672 DO_ASSERT(get_jenv_res == JNI_OK);
12674 LDKOutPoint channel_id_var = channel_id;
12675 int64_t channel_id_ref = 0;
12676 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
12677 channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned);
12678 LDKChannelMonitor data_var = *data;
12679 int64_t data_ref = 0;
12680 data_var = ChannelMonitor_clone(&data_var);
12681 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
12682 data_ref = tag_ptr(data_var.inner, data_var.is_owned);
12683 LDKMonitorUpdateId update_id_var = update_id;
12684 int64_t update_id_ref = 0;
12685 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
12686 update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
12687 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12688 CHECK(obj != NULL);
12689 jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->persist_new_channel_meth, channel_id_ref, data_ref, update_id_ref);
12690 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12691 (*env)->ExceptionDescribe(env);
12692 (*env)->FatalError(env, "A call to persist_new_channel in LDKPersist from rust threw an exception.");
12694 LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
12695 if (get_jenv_res == JNI_EDETACHED) {
12696 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12700 LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, LDKChannelMonitorUpdate update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
12701 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
12703 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12704 if (get_jenv_res == JNI_EDETACHED) {
12705 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12707 DO_ASSERT(get_jenv_res == JNI_OK);
12709 LDKOutPoint channel_id_var = channel_id;
12710 int64_t channel_id_ref = 0;
12711 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
12712 channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned);
12713 LDKChannelMonitorUpdate update_var = update;
12714 int64_t update_ref = 0;
12715 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
12716 update_ref = tag_ptr(update_var.inner, update_var.is_owned);
12717 LDKChannelMonitor data_var = *data;
12718 int64_t data_ref = 0;
12719 data_var = ChannelMonitor_clone(&data_var);
12720 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
12721 data_ref = tag_ptr(data_var.inner, data_var.is_owned);
12722 LDKMonitorUpdateId update_id_var = update_id;
12723 int64_t update_id_ref = 0;
12724 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
12725 update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
12726 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12727 CHECK(obj != NULL);
12728 jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->update_persisted_channel_meth, channel_id_ref, update_ref, data_ref, update_id_ref);
12729 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12730 (*env)->ExceptionDescribe(env);
12731 (*env)->FatalError(env, "A call to update_persisted_channel in LDKPersist from rust threw an exception.");
12733 LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
12734 if (get_jenv_res == JNI_EDETACHED) {
12735 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12739 static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) {
12740 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) new_obj->this_arg;
12741 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
12743 static inline LDKPersist LDKPersist_init (JNIEnv *env, jclass clz, jobject o) {
12744 jclass c = (*env)->GetObjectClass(env, o);
12746 LDKPersist_JCalls *calls = MALLOC(sizeof(LDKPersist_JCalls), "LDKPersist_JCalls");
12747 atomic_init(&calls->refcnt, 1);
12748 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
12749 calls->o = (*env)->NewWeakGlobalRef(env, o);
12750 calls->persist_new_channel_meth = (*env)->GetMethodID(env, c, "persist_new_channel", "(JJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
12751 CHECK(calls->persist_new_channel_meth != NULL);
12752 calls->update_persisted_channel_meth = (*env)->GetMethodID(env, c, "update_persisted_channel", "(JJJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
12753 CHECK(calls->update_persisted_channel_meth != NULL);
12756 .this_arg = (void*) calls,
12757 .persist_new_channel = persist_new_channel_LDKPersist_jcall,
12758 .update_persisted_channel = update_persisted_channel_LDKPersist_jcall,
12759 .free = LDKPersist_JCalls_free,
12763 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPersist_1new(JNIEnv *env, jclass clz, jobject o) {
12764 LDKPersist *res_ptr = MALLOC(sizeof(LDKPersist), "LDKPersist");
12765 *res_ptr = LDKPersist_init(env, clz, o);
12766 return tag_ptr(res_ptr, true);
12768 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) {
12769 void* this_arg_ptr = untag_ptr(this_arg);
12770 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12771 LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
12772 LDKOutPoint channel_id_conv;
12773 channel_id_conv.inner = untag_ptr(channel_id);
12774 channel_id_conv.is_owned = ptr_is_owned(channel_id);
12775 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
12776 channel_id_conv = OutPoint_clone(&channel_id_conv);
12777 LDKChannelMonitor data_conv;
12778 data_conv.inner = untag_ptr(data);
12779 data_conv.is_owned = ptr_is_owned(data);
12780 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
12781 data_conv.is_owned = false;
12782 LDKMonitorUpdateId update_id_conv;
12783 update_id_conv.inner = untag_ptr(update_id);
12784 update_id_conv.is_owned = ptr_is_owned(update_id);
12785 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
12786 update_id_conv = MonitorUpdateId_clone(&update_id_conv);
12787 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));
12791 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) {
12792 void* this_arg_ptr = untag_ptr(this_arg);
12793 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12794 LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
12795 LDKOutPoint channel_id_conv;
12796 channel_id_conv.inner = untag_ptr(channel_id);
12797 channel_id_conv.is_owned = ptr_is_owned(channel_id);
12798 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
12799 channel_id_conv = OutPoint_clone(&channel_id_conv);
12800 LDKChannelMonitorUpdate update_conv;
12801 update_conv.inner = untag_ptr(update);
12802 update_conv.is_owned = ptr_is_owned(update);
12803 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
12804 update_conv = ChannelMonitorUpdate_clone(&update_conv);
12805 LDKChannelMonitor data_conv;
12806 data_conv.inner = untag_ptr(data);
12807 data_conv.is_owned = ptr_is_owned(data);
12808 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
12809 data_conv.is_owned = false;
12810 LDKMonitorUpdateId update_id_conv;
12811 update_id_conv.inner = untag_ptr(update_id);
12812 update_id_conv.is_owned = ptr_is_owned(update_id);
12813 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
12814 update_id_conv = MonitorUpdateId_clone(&update_id_conv);
12815 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));
12819 typedef struct LDKEventHandler_JCalls {
12820 atomic_size_t refcnt;
12823 jmethodID handle_event_meth;
12824 } LDKEventHandler_JCalls;
12825 static void LDKEventHandler_JCalls_free(void* this_arg) {
12826 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
12827 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
12829 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12830 if (get_jenv_res == JNI_EDETACHED) {
12831 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12833 DO_ASSERT(get_jenv_res == JNI_OK);
12835 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
12836 if (get_jenv_res == JNI_EDETACHED) {
12837 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12842 void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) {
12843 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
12845 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12846 if (get_jenv_res == JNI_EDETACHED) {
12847 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12849 DO_ASSERT(get_jenv_res == JNI_OK);
12851 LDKEvent *event_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
12852 *event_copy = event;
12853 int64_t event_ref = tag_ptr(event_copy, true);
12854 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12855 CHECK(obj != NULL);
12856 (*env)->CallVoidMethod(env, obj, j_calls->handle_event_meth, event_ref);
12857 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12858 (*env)->ExceptionDescribe(env);
12859 (*env)->FatalError(env, "A call to handle_event in LDKEventHandler from rust threw an exception.");
12861 if (get_jenv_res == JNI_EDETACHED) {
12862 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12865 static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) {
12866 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg;
12867 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
12869 static inline LDKEventHandler LDKEventHandler_init (JNIEnv *env, jclass clz, jobject o) {
12870 jclass c = (*env)->GetObjectClass(env, o);
12872 LDKEventHandler_JCalls *calls = MALLOC(sizeof(LDKEventHandler_JCalls), "LDKEventHandler_JCalls");
12873 atomic_init(&calls->refcnt, 1);
12874 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
12875 calls->o = (*env)->NewWeakGlobalRef(env, o);
12876 calls->handle_event_meth = (*env)->GetMethodID(env, c, "handle_event", "(J)V");
12877 CHECK(calls->handle_event_meth != NULL);
12879 LDKEventHandler ret = {
12880 .this_arg = (void*) calls,
12881 .handle_event = handle_event_LDKEventHandler_jcall,
12882 .free = LDKEventHandler_JCalls_free,
12886 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKEventHandler_1new(JNIEnv *env, jclass clz, jobject o) {
12887 LDKEventHandler *res_ptr = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
12888 *res_ptr = LDKEventHandler_init(env, clz, o);
12889 return tag_ptr(res_ptr, true);
12891 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1handle_1event(JNIEnv *env, jclass clz, int64_t this_arg, int64_t event) {
12892 void* this_arg_ptr = untag_ptr(this_arg);
12893 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12894 LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr;
12895 void* event_ptr = untag_ptr(event);
12896 CHECK_ACCESS(event_ptr);
12897 LDKEvent event_conv = *(LDKEvent*)(event_ptr);
12898 event_conv = Event_clone((LDKEvent*)untag_ptr(event));
12899 (this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv);
12902 typedef struct LDKEventsProvider_JCalls {
12903 atomic_size_t refcnt;
12906 jmethodID process_pending_events_meth;
12907 } LDKEventsProvider_JCalls;
12908 static void LDKEventsProvider_JCalls_free(void* this_arg) {
12909 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
12910 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
12912 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12913 if (get_jenv_res == JNI_EDETACHED) {
12914 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12916 DO_ASSERT(get_jenv_res == JNI_OK);
12918 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
12919 if (get_jenv_res == JNI_EDETACHED) {
12920 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12925 void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEventHandler handler) {
12926 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
12928 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
12929 if (get_jenv_res == JNI_EDETACHED) {
12930 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
12932 DO_ASSERT(get_jenv_res == JNI_OK);
12934 LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
12935 *handler_ret = handler;
12936 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
12937 CHECK(obj != NULL);
12938 (*env)->CallVoidMethod(env, obj, j_calls->process_pending_events_meth, tag_ptr(handler_ret, true));
12939 if (UNLIKELY((*env)->ExceptionCheck(env))) {
12940 (*env)->ExceptionDescribe(env);
12941 (*env)->FatalError(env, "A call to process_pending_events in LDKEventsProvider from rust threw an exception.");
12943 if (get_jenv_res == JNI_EDETACHED) {
12944 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
12947 static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) {
12948 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg;
12949 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
12951 static inline LDKEventsProvider LDKEventsProvider_init (JNIEnv *env, jclass clz, jobject o) {
12952 jclass c = (*env)->GetObjectClass(env, o);
12954 LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
12955 atomic_init(&calls->refcnt, 1);
12956 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
12957 calls->o = (*env)->NewWeakGlobalRef(env, o);
12958 calls->process_pending_events_meth = (*env)->GetMethodID(env, c, "process_pending_events", "(J)V");
12959 CHECK(calls->process_pending_events_meth != NULL);
12961 LDKEventsProvider ret = {
12962 .this_arg = (void*) calls,
12963 .process_pending_events = process_pending_events_LDKEventsProvider_jcall,
12964 .free = LDKEventsProvider_JCalls_free,
12968 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new(JNIEnv *env, jclass clz, jobject o) {
12969 LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
12970 *res_ptr = LDKEventsProvider_init(env, clz, o);
12971 return tag_ptr(res_ptr, true);
12973 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1process_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg, int64_t handler) {
12974 void* this_arg_ptr = untag_ptr(this_arg);
12975 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
12976 LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg_ptr;
12977 void* handler_ptr = untag_ptr(handler);
12978 CHECK_ACCESS(handler_ptr);
12979 LDKEventHandler handler_conv = *(LDKEventHandler*)(handler_ptr);
12980 if (handler_conv.free == LDKEventHandler_JCalls_free) {
12981 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
12982 LDKEventHandler_JCalls_cloned(&handler_conv);
12984 (this_arg_conv->process_pending_events)(this_arg_conv->this_arg, handler_conv);
12987 static jclass LDKRetry_Attempts_class = NULL;
12988 static jmethodID LDKRetry_Attempts_meth = NULL;
12989 static jclass LDKRetry_Timeout_class = NULL;
12990 static jmethodID LDKRetry_Timeout_meth = NULL;
12991 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKRetry_init (JNIEnv *env, jclass clz) {
12992 LDKRetry_Attempts_class =
12993 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Attempts"));
12994 CHECK(LDKRetry_Attempts_class != NULL);
12995 LDKRetry_Attempts_meth = (*env)->GetMethodID(env, LDKRetry_Attempts_class, "<init>", "(J)V");
12996 CHECK(LDKRetry_Attempts_meth != NULL);
12997 LDKRetry_Timeout_class =
12998 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKRetry$Timeout"));
12999 CHECK(LDKRetry_Timeout_class != NULL);
13000 LDKRetry_Timeout_meth = (*env)->GetMethodID(env, LDKRetry_Timeout_class, "<init>", "(J)V");
13001 CHECK(LDKRetry_Timeout_meth != NULL);
13003 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRetry_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
13004 LDKRetry *obj = (LDKRetry*)untag_ptr(ptr);
13006 case LDKRetry_Attempts: {
13007 int64_t attempts_conv = obj->attempts;
13008 return (*env)->NewObject(env, LDKRetry_Attempts_class, LDKRetry_Attempts_meth, attempts_conv);
13010 case LDKRetry_Timeout: {
13011 int64_t timeout_conv = obj->timeout;
13012 return (*env)->NewObject(env, LDKRetry_Timeout_class, LDKRetry_Timeout_meth, timeout_conv);
13017 typedef struct LDKMessageSendEventsProvider_JCalls {
13018 atomic_size_t refcnt;
13021 jmethodID get_and_clear_pending_msg_events_meth;
13022 } LDKMessageSendEventsProvider_JCalls;
13023 static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) {
13024 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
13025 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
13027 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13028 if (get_jenv_res == JNI_EDETACHED) {
13029 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13031 DO_ASSERT(get_jenv_res == JNI_OK);
13033 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
13034 if (get_jenv_res == JNI_EDETACHED) {
13035 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13040 LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall(const void* this_arg) {
13041 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
13043 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13044 if (get_jenv_res == JNI_EDETACHED) {
13045 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13047 DO_ASSERT(get_jenv_res == JNI_OK);
13049 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13050 CHECK(obj != NULL);
13051 int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_pending_msg_events_meth);
13052 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13053 (*env)->ExceptionDescribe(env);
13054 (*env)->FatalError(env, "A call to get_and_clear_pending_msg_events in LDKMessageSendEventsProvider from rust threw an exception.");
13056 LDKCVec_MessageSendEventZ ret_constr;
13057 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
13058 if (ret_constr.datalen > 0)
13059 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
13061 ret_constr.data = NULL;
13062 int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
13063 for (size_t s = 0; s < ret_constr.datalen; s++) {
13064 int64_t ret_conv_18 = ret_vals[s];
13065 void* ret_conv_18_ptr = untag_ptr(ret_conv_18);
13066 CHECK_ACCESS(ret_conv_18_ptr);
13067 LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr);
13068 FREE(untag_ptr(ret_conv_18));
13069 ret_constr.data[s] = ret_conv_18_conv;
13071 (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
13072 if (get_jenv_res == JNI_EDETACHED) {
13073 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13077 static void LDKMessageSendEventsProvider_JCalls_cloned(LDKMessageSendEventsProvider* new_obj) {
13078 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) new_obj->this_arg;
13079 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
13081 static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JNIEnv *env, jclass clz, jobject o) {
13082 jclass c = (*env)->GetObjectClass(env, o);
13084 LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls");
13085 atomic_init(&calls->refcnt, 1);
13086 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
13087 calls->o = (*env)->NewWeakGlobalRef(env, o);
13088 calls->get_and_clear_pending_msg_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg_events", "()[J");
13089 CHECK(calls->get_and_clear_pending_msg_events_meth != NULL);
13091 LDKMessageSendEventsProvider ret = {
13092 .this_arg = (void*) calls,
13093 .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall,
13094 .free = LDKMessageSendEventsProvider_JCalls_free,
13098 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new(JNIEnv *env, jclass clz, jobject o) {
13099 LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
13100 *res_ptr = LDKMessageSendEventsProvider_init(env, clz, o);
13101 return tag_ptr(res_ptr, true);
13103 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1get_1and_1clear_1pending_1msg_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
13104 void* this_arg_ptr = untag_ptr(this_arg);
13105 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13106 LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr;
13107 LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg);
13108 int64_tArray ret_arr = NULL;
13109 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
13110 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
13111 for (size_t s = 0; s < ret_var.datalen; s++) {
13112 LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
13113 *ret_conv_18_copy = ret_var.data[s];
13114 int64_t ret_conv_18_ref = tag_ptr(ret_conv_18_copy, true);
13115 ret_arr_ptr[s] = ret_conv_18_ref;
13117 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
13118 FREE(ret_var.data);
13122 typedef struct LDKChannelMessageHandler_JCalls {
13123 atomic_size_t refcnt;
13126 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
13127 jmethodID handle_open_channel_meth;
13128 jmethodID handle_accept_channel_meth;
13129 jmethodID handle_funding_created_meth;
13130 jmethodID handle_funding_signed_meth;
13131 jmethodID handle_channel_ready_meth;
13132 jmethodID handle_shutdown_meth;
13133 jmethodID handle_closing_signed_meth;
13134 jmethodID handle_update_add_htlc_meth;
13135 jmethodID handle_update_fulfill_htlc_meth;
13136 jmethodID handle_update_fail_htlc_meth;
13137 jmethodID handle_update_fail_malformed_htlc_meth;
13138 jmethodID handle_commitment_signed_meth;
13139 jmethodID handle_revoke_and_ack_meth;
13140 jmethodID handle_update_fee_meth;
13141 jmethodID handle_announcement_signatures_meth;
13142 jmethodID peer_disconnected_meth;
13143 jmethodID peer_connected_meth;
13144 jmethodID handle_channel_reestablish_meth;
13145 jmethodID handle_channel_update_meth;
13146 jmethodID handle_error_meth;
13147 jmethodID provided_node_features_meth;
13148 jmethodID provided_init_features_meth;
13149 } LDKChannelMessageHandler_JCalls;
13150 static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
13151 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13152 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
13154 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13155 if (get_jenv_res == JNI_EDETACHED) {
13156 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13158 DO_ASSERT(get_jenv_res == JNI_OK);
13160 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
13161 if (get_jenv_res == JNI_EDETACHED) {
13162 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13167 void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKOpenChannel * msg) {
13168 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13170 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13171 if (get_jenv_res == JNI_EDETACHED) {
13172 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13174 DO_ASSERT(get_jenv_res == JNI_OK);
13176 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13177 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13178 LDKOpenChannel msg_var = *msg;
13179 int64_t msg_ref = 0;
13180 msg_var = OpenChannel_clone(&msg_var);
13181 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13182 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13183 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13184 CHECK(obj != NULL);
13185 (*env)->CallVoidMethod(env, obj, j_calls->handle_open_channel_meth, their_node_id_arr, msg_ref);
13186 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13187 (*env)->ExceptionDescribe(env);
13188 (*env)->FatalError(env, "A call to handle_open_channel in LDKChannelMessageHandler from rust threw an exception.");
13190 if (get_jenv_res == JNI_EDETACHED) {
13191 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13194 void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAcceptChannel * msg) {
13195 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13197 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13198 if (get_jenv_res == JNI_EDETACHED) {
13199 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13201 DO_ASSERT(get_jenv_res == JNI_OK);
13203 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13204 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13205 LDKAcceptChannel msg_var = *msg;
13206 int64_t msg_ref = 0;
13207 msg_var = AcceptChannel_clone(&msg_var);
13208 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13209 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13210 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13211 CHECK(obj != NULL);
13212 (*env)->CallVoidMethod(env, obj, j_calls->handle_accept_channel_meth, their_node_id_arr, msg_ref);
13213 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13214 (*env)->ExceptionDescribe(env);
13215 (*env)->FatalError(env, "A call to handle_accept_channel in LDKChannelMessageHandler from rust threw an exception.");
13217 if (get_jenv_res == JNI_EDETACHED) {
13218 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13221 void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) {
13222 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13224 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13225 if (get_jenv_res == JNI_EDETACHED) {
13226 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13228 DO_ASSERT(get_jenv_res == JNI_OK);
13230 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13231 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13232 LDKFundingCreated msg_var = *msg;
13233 int64_t msg_ref = 0;
13234 msg_var = FundingCreated_clone(&msg_var);
13235 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13236 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13237 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13238 CHECK(obj != NULL);
13239 (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_created_meth, their_node_id_arr, msg_ref);
13240 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13241 (*env)->ExceptionDescribe(env);
13242 (*env)->FatalError(env, "A call to handle_funding_created in LDKChannelMessageHandler from rust threw an exception.");
13244 if (get_jenv_res == JNI_EDETACHED) {
13245 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13248 void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) {
13249 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13251 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13252 if (get_jenv_res == JNI_EDETACHED) {
13253 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13255 DO_ASSERT(get_jenv_res == JNI_OK);
13257 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13258 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13259 LDKFundingSigned msg_var = *msg;
13260 int64_t msg_ref = 0;
13261 msg_var = FundingSigned_clone(&msg_var);
13262 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13263 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13264 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13265 CHECK(obj != NULL);
13266 (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_signed_meth, their_node_id_arr, msg_ref);
13267 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13268 (*env)->ExceptionDescribe(env);
13269 (*env)->FatalError(env, "A call to handle_funding_signed in LDKChannelMessageHandler from rust threw an exception.");
13271 if (get_jenv_res == JNI_EDETACHED) {
13272 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13275 void handle_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReady * msg) {
13276 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13278 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13279 if (get_jenv_res == JNI_EDETACHED) {
13280 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13282 DO_ASSERT(get_jenv_res == JNI_OK);
13284 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13285 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13286 LDKChannelReady msg_var = *msg;
13287 int64_t msg_ref = 0;
13288 msg_var = ChannelReady_clone(&msg_var);
13289 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13290 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13291 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13292 CHECK(obj != NULL);
13293 (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_ready_meth, their_node_id_arr, msg_ref);
13294 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13295 (*env)->ExceptionDescribe(env);
13296 (*env)->FatalError(env, "A call to handle_channel_ready in LDKChannelMessageHandler from rust threw an exception.");
13298 if (get_jenv_res == JNI_EDETACHED) {
13299 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13302 void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown * msg) {
13303 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13305 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13306 if (get_jenv_res == JNI_EDETACHED) {
13307 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13309 DO_ASSERT(get_jenv_res == JNI_OK);
13311 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13312 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13313 LDKShutdown msg_var = *msg;
13314 int64_t msg_ref = 0;
13315 msg_var = Shutdown_clone(&msg_var);
13316 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13317 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13318 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13319 CHECK(obj != NULL);
13320 (*env)->CallVoidMethod(env, obj, j_calls->handle_shutdown_meth, their_node_id_arr, msg_ref);
13321 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13322 (*env)->ExceptionDescribe(env);
13323 (*env)->FatalError(env, "A call to handle_shutdown in LDKChannelMessageHandler from rust threw an exception.");
13325 if (get_jenv_res == JNI_EDETACHED) {
13326 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13329 void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) {
13330 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13332 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13333 if (get_jenv_res == JNI_EDETACHED) {
13334 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13336 DO_ASSERT(get_jenv_res == JNI_OK);
13338 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13339 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13340 LDKClosingSigned msg_var = *msg;
13341 int64_t msg_ref = 0;
13342 msg_var = ClosingSigned_clone(&msg_var);
13343 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13344 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13345 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13346 CHECK(obj != NULL);
13347 (*env)->CallVoidMethod(env, obj, j_calls->handle_closing_signed_meth, their_node_id_arr, msg_ref);
13348 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13349 (*env)->ExceptionDescribe(env);
13350 (*env)->FatalError(env, "A call to handle_closing_signed in LDKChannelMessageHandler from rust threw an exception.");
13352 if (get_jenv_res == JNI_EDETACHED) {
13353 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13356 void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) {
13357 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13359 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13360 if (get_jenv_res == JNI_EDETACHED) {
13361 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13363 DO_ASSERT(get_jenv_res == JNI_OK);
13365 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13366 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13367 LDKUpdateAddHTLC msg_var = *msg;
13368 int64_t msg_ref = 0;
13369 msg_var = UpdateAddHTLC_clone(&msg_var);
13370 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13371 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13372 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13373 CHECK(obj != NULL);
13374 (*env)->CallVoidMethod(env, obj, j_calls->handle_update_add_htlc_meth, their_node_id_arr, msg_ref);
13375 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13376 (*env)->ExceptionDescribe(env);
13377 (*env)->FatalError(env, "A call to handle_update_add_htlc in LDKChannelMessageHandler from rust threw an exception.");
13379 if (get_jenv_res == JNI_EDETACHED) {
13380 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13383 void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) {
13384 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13386 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13387 if (get_jenv_res == JNI_EDETACHED) {
13388 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13390 DO_ASSERT(get_jenv_res == JNI_OK);
13392 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13393 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13394 LDKUpdateFulfillHTLC msg_var = *msg;
13395 int64_t msg_ref = 0;
13396 msg_var = UpdateFulfillHTLC_clone(&msg_var);
13397 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13398 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13399 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13400 CHECK(obj != NULL);
13401 (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fulfill_htlc_meth, their_node_id_arr, msg_ref);
13402 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13403 (*env)->ExceptionDescribe(env);
13404 (*env)->FatalError(env, "A call to handle_update_fulfill_htlc in LDKChannelMessageHandler from rust threw an exception.");
13406 if (get_jenv_res == JNI_EDETACHED) {
13407 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13410 void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) {
13411 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13413 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13414 if (get_jenv_res == JNI_EDETACHED) {
13415 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13417 DO_ASSERT(get_jenv_res == JNI_OK);
13419 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13420 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13421 LDKUpdateFailHTLC msg_var = *msg;
13422 int64_t msg_ref = 0;
13423 msg_var = UpdateFailHTLC_clone(&msg_var);
13424 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13425 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13426 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13427 CHECK(obj != NULL);
13428 (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_htlc_meth, their_node_id_arr, msg_ref);
13429 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13430 (*env)->ExceptionDescribe(env);
13431 (*env)->FatalError(env, "A call to handle_update_fail_htlc in LDKChannelMessageHandler from rust threw an exception.");
13433 if (get_jenv_res == JNI_EDETACHED) {
13434 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13437 void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) {
13438 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13440 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13441 if (get_jenv_res == JNI_EDETACHED) {
13442 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13444 DO_ASSERT(get_jenv_res == JNI_OK);
13446 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13447 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13448 LDKUpdateFailMalformedHTLC msg_var = *msg;
13449 int64_t msg_ref = 0;
13450 msg_var = UpdateFailMalformedHTLC_clone(&msg_var);
13451 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13452 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13453 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13454 CHECK(obj != NULL);
13455 (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id_arr, msg_ref);
13456 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13457 (*env)->ExceptionDescribe(env);
13458 (*env)->FatalError(env, "A call to handle_update_fail_malformed_htlc in LDKChannelMessageHandler from rust threw an exception.");
13460 if (get_jenv_res == JNI_EDETACHED) {
13461 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13464 void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * 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 LDKCommitmentSigned msg_var = *msg;
13476 int64_t msg_ref = 0;
13477 msg_var = CommitmentSigned_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_commitment_signed_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_commitment_signed 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_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * 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 LDKRevokeAndACK msg_var = *msg;
13503 int64_t msg_ref = 0;
13504 msg_var = RevokeAndACK_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_revoke_and_ack_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_revoke_and_ack 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_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * 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 LDKUpdateFee msg_var = *msg;
13530 int64_t msg_ref = 0;
13531 msg_var = UpdateFee_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_update_fee_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_update_fee 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 void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) {
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 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13555 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13556 LDKAnnouncementSignatures msg_var = *msg;
13557 int64_t msg_ref = 0;
13558 msg_var = AnnouncementSignatures_clone(&msg_var);
13559 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13560 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13561 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13562 CHECK(obj != NULL);
13563 (*env)->CallVoidMethod(env, obj, j_calls->handle_announcement_signatures_meth, their_node_id_arr, msg_ref);
13564 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13565 (*env)->ExceptionDescribe(env);
13566 (*env)->FatalError(env, "A call to handle_announcement_signatures in LDKChannelMessageHandler from rust threw an exception.");
13568 if (get_jenv_res == JNI_EDETACHED) {
13569 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13572 void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
13573 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13575 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13576 if (get_jenv_res == JNI_EDETACHED) {
13577 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13579 DO_ASSERT(get_jenv_res == JNI_OK);
13581 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13582 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13583 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13584 CHECK(obj != NULL);
13585 (*env)->CallVoidMethod(env, obj, j_calls->peer_disconnected_meth, their_node_id_arr);
13586 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13587 (*env)->ExceptionDescribe(env);
13588 (*env)->FatalError(env, "A call to peer_disconnected in LDKChannelMessageHandler from rust threw an exception.");
13590 if (get_jenv_res == JNI_EDETACHED) {
13591 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13594 LDKCResult_NoneNoneZ peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg, bool inbound) {
13595 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13597 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13598 if (get_jenv_res == JNI_EDETACHED) {
13599 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13601 DO_ASSERT(get_jenv_res == JNI_OK);
13603 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13604 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13605 LDKInit msg_var = *msg;
13606 int64_t msg_ref = 0;
13607 msg_var = Init_clone(&msg_var);
13608 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13609 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13610 jboolean inbound_conv = inbound;
13611 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13612 CHECK(obj != NULL);
13613 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, msg_ref, inbound_conv);
13614 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13615 (*env)->ExceptionDescribe(env);
13616 (*env)->FatalError(env, "A call to peer_connected in LDKChannelMessageHandler from rust threw an exception.");
13618 void* ret_ptr = untag_ptr(ret);
13619 CHECK_ACCESS(ret_ptr);
13620 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
13621 FREE(untag_ptr(ret));
13622 if (get_jenv_res == JNI_EDETACHED) {
13623 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13627 void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
13628 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13630 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13631 if (get_jenv_res == JNI_EDETACHED) {
13632 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13634 DO_ASSERT(get_jenv_res == JNI_OK);
13636 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13637 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13638 LDKChannelReestablish msg_var = *msg;
13639 int64_t msg_ref = 0;
13640 msg_var = ChannelReestablish_clone(&msg_var);
13641 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13642 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13643 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13644 CHECK(obj != NULL);
13645 (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_reestablish_meth, their_node_id_arr, msg_ref);
13646 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13647 (*env)->ExceptionDescribe(env);
13648 (*env)->FatalError(env, "A call to handle_channel_reestablish in LDKChannelMessageHandler from rust threw an exception.");
13650 if (get_jenv_res == JNI_EDETACHED) {
13651 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13654 void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) {
13655 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13657 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13658 if (get_jenv_res == JNI_EDETACHED) {
13659 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13661 DO_ASSERT(get_jenv_res == JNI_OK);
13663 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13664 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13665 LDKChannelUpdate msg_var = *msg;
13666 int64_t msg_ref = 0;
13667 msg_var = ChannelUpdate_clone(&msg_var);
13668 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13669 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13670 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13671 CHECK(obj != NULL);
13672 (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_update_meth, their_node_id_arr, msg_ref);
13673 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13674 (*env)->ExceptionDescribe(env);
13675 (*env)->FatalError(env, "A call to handle_channel_update in LDKChannelMessageHandler from rust threw an exception.");
13677 if (get_jenv_res == JNI_EDETACHED) {
13678 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13681 void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) {
13682 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13684 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13685 if (get_jenv_res == JNI_EDETACHED) {
13686 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13688 DO_ASSERT(get_jenv_res == JNI_OK);
13690 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13691 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13692 LDKErrorMessage msg_var = *msg;
13693 int64_t msg_ref = 0;
13694 msg_var = ErrorMessage_clone(&msg_var);
13695 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
13696 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
13697 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13698 CHECK(obj != NULL);
13699 (*env)->CallVoidMethod(env, obj, j_calls->handle_error_meth, their_node_id_arr, msg_ref);
13700 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13701 (*env)->ExceptionDescribe(env);
13702 (*env)->FatalError(env, "A call to handle_error in LDKChannelMessageHandler from rust threw an exception.");
13704 if (get_jenv_res == JNI_EDETACHED) {
13705 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13708 LDKNodeFeatures provided_node_features_LDKChannelMessageHandler_jcall(const void* this_arg) {
13709 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13711 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13712 if (get_jenv_res == JNI_EDETACHED) {
13713 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13715 DO_ASSERT(get_jenv_res == JNI_OK);
13717 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13718 CHECK(obj != NULL);
13719 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_node_features_meth);
13720 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13721 (*env)->ExceptionDescribe(env);
13722 (*env)->FatalError(env, "A call to provided_node_features in LDKChannelMessageHandler from rust threw an exception.");
13724 LDKNodeFeatures ret_conv;
13725 ret_conv.inner = untag_ptr(ret);
13726 ret_conv.is_owned = ptr_is_owned(ret);
13727 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
13728 if (get_jenv_res == JNI_EDETACHED) {
13729 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13733 LDKInitFeatures provided_init_features_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
13734 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
13736 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
13737 if (get_jenv_res == JNI_EDETACHED) {
13738 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
13740 DO_ASSERT(get_jenv_res == JNI_OK);
13742 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
13743 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
13744 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
13745 CHECK(obj != NULL);
13746 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_init_features_meth, their_node_id_arr);
13747 if (UNLIKELY((*env)->ExceptionCheck(env))) {
13748 (*env)->ExceptionDescribe(env);
13749 (*env)->FatalError(env, "A call to provided_init_features in LDKChannelMessageHandler from rust threw an exception.");
13751 LDKInitFeatures ret_conv;
13752 ret_conv.inner = untag_ptr(ret);
13753 ret_conv.is_owned = ptr_is_owned(ret);
13754 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
13755 if (get_jenv_res == JNI_EDETACHED) {
13756 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
13760 static void LDKChannelMessageHandler_JCalls_cloned(LDKChannelMessageHandler* new_obj) {
13761 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) new_obj->this_arg;
13762 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
13763 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
13765 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
13766 jclass c = (*env)->GetObjectClass(env, o);
13768 LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
13769 atomic_init(&calls->refcnt, 1);
13770 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
13771 calls->o = (*env)->NewWeakGlobalRef(env, o);
13772 calls->handle_open_channel_meth = (*env)->GetMethodID(env, c, "handle_open_channel", "([BJ)V");
13773 CHECK(calls->handle_open_channel_meth != NULL);
13774 calls->handle_accept_channel_meth = (*env)->GetMethodID(env, c, "handle_accept_channel", "([BJ)V");
13775 CHECK(calls->handle_accept_channel_meth != NULL);
13776 calls->handle_funding_created_meth = (*env)->GetMethodID(env, c, "handle_funding_created", "([BJ)V");
13777 CHECK(calls->handle_funding_created_meth != NULL);
13778 calls->handle_funding_signed_meth = (*env)->GetMethodID(env, c, "handle_funding_signed", "([BJ)V");
13779 CHECK(calls->handle_funding_signed_meth != NULL);
13780 calls->handle_channel_ready_meth = (*env)->GetMethodID(env, c, "handle_channel_ready", "([BJ)V");
13781 CHECK(calls->handle_channel_ready_meth != NULL);
13782 calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "([BJ)V");
13783 CHECK(calls->handle_shutdown_meth != NULL);
13784 calls->handle_closing_signed_meth = (*env)->GetMethodID(env, c, "handle_closing_signed", "([BJ)V");
13785 CHECK(calls->handle_closing_signed_meth != NULL);
13786 calls->handle_update_add_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_add_htlc", "([BJ)V");
13787 CHECK(calls->handle_update_add_htlc_meth != NULL);
13788 calls->handle_update_fulfill_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fulfill_htlc", "([BJ)V");
13789 CHECK(calls->handle_update_fulfill_htlc_meth != NULL);
13790 calls->handle_update_fail_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_htlc", "([BJ)V");
13791 CHECK(calls->handle_update_fail_htlc_meth != NULL);
13792 calls->handle_update_fail_malformed_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_malformed_htlc", "([BJ)V");
13793 CHECK(calls->handle_update_fail_malformed_htlc_meth != NULL);
13794 calls->handle_commitment_signed_meth = (*env)->GetMethodID(env, c, "handle_commitment_signed", "([BJ)V");
13795 CHECK(calls->handle_commitment_signed_meth != NULL);
13796 calls->handle_revoke_and_ack_meth = (*env)->GetMethodID(env, c, "handle_revoke_and_ack", "([BJ)V");
13797 CHECK(calls->handle_revoke_and_ack_meth != NULL);
13798 calls->handle_update_fee_meth = (*env)->GetMethodID(env, c, "handle_update_fee", "([BJ)V");
13799 CHECK(calls->handle_update_fee_meth != NULL);
13800 calls->handle_announcement_signatures_meth = (*env)->GetMethodID(env, c, "handle_announcement_signatures", "([BJ)V");
13801 CHECK(calls->handle_announcement_signatures_meth != NULL);
13802 calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "([B)V");
13803 CHECK(calls->peer_disconnected_meth != NULL);
13804 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJZ)J");
13805 CHECK(calls->peer_connected_meth != NULL);
13806 calls->handle_channel_reestablish_meth = (*env)->GetMethodID(env, c, "handle_channel_reestablish", "([BJ)V");
13807 CHECK(calls->handle_channel_reestablish_meth != NULL);
13808 calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "([BJ)V");
13809 CHECK(calls->handle_channel_update_meth != NULL);
13810 calls->handle_error_meth = (*env)->GetMethodID(env, c, "handle_error", "([BJ)V");
13811 CHECK(calls->handle_error_meth != NULL);
13812 calls->provided_node_features_meth = (*env)->GetMethodID(env, c, "provided_node_features", "()J");
13813 CHECK(calls->provided_node_features_meth != NULL);
13814 calls->provided_init_features_meth = (*env)->GetMethodID(env, c, "provided_init_features", "([B)J");
13815 CHECK(calls->provided_init_features_meth != NULL);
13817 LDKChannelMessageHandler ret = {
13818 .this_arg = (void*) calls,
13819 .handle_open_channel = handle_open_channel_LDKChannelMessageHandler_jcall,
13820 .handle_accept_channel = handle_accept_channel_LDKChannelMessageHandler_jcall,
13821 .handle_funding_created = handle_funding_created_LDKChannelMessageHandler_jcall,
13822 .handle_funding_signed = handle_funding_signed_LDKChannelMessageHandler_jcall,
13823 .handle_channel_ready = handle_channel_ready_LDKChannelMessageHandler_jcall,
13824 .handle_shutdown = handle_shutdown_LDKChannelMessageHandler_jcall,
13825 .handle_closing_signed = handle_closing_signed_LDKChannelMessageHandler_jcall,
13826 .handle_update_add_htlc = handle_update_add_htlc_LDKChannelMessageHandler_jcall,
13827 .handle_update_fulfill_htlc = handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall,
13828 .handle_update_fail_htlc = handle_update_fail_htlc_LDKChannelMessageHandler_jcall,
13829 .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall,
13830 .handle_commitment_signed = handle_commitment_signed_LDKChannelMessageHandler_jcall,
13831 .handle_revoke_and_ack = handle_revoke_and_ack_LDKChannelMessageHandler_jcall,
13832 .handle_update_fee = handle_update_fee_LDKChannelMessageHandler_jcall,
13833 .handle_announcement_signatures = handle_announcement_signatures_LDKChannelMessageHandler_jcall,
13834 .peer_disconnected = peer_disconnected_LDKChannelMessageHandler_jcall,
13835 .peer_connected = peer_connected_LDKChannelMessageHandler_jcall,
13836 .handle_channel_reestablish = handle_channel_reestablish_LDKChannelMessageHandler_jcall,
13837 .handle_channel_update = handle_channel_update_LDKChannelMessageHandler_jcall,
13838 .handle_error = handle_error_LDKChannelMessageHandler_jcall,
13839 .provided_node_features = provided_node_features_LDKChannelMessageHandler_jcall,
13840 .provided_init_features = provided_init_features_LDKChannelMessageHandler_jcall,
13841 .free = LDKChannelMessageHandler_JCalls_free,
13842 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, clz, MessageSendEventsProvider),
13844 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
13847 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new(JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
13848 LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
13849 *res_ptr = LDKChannelMessageHandler_init(env, clz, o, MessageSendEventsProvider);
13850 return tag_ptr(res_ptr, true);
13852 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t arg) {
13853 LDKChannelMessageHandler *inp = (LDKChannelMessageHandler *)untag_ptr(arg);
13854 return tag_ptr(&inp->MessageSendEventsProvider, false);
13856 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) {
13857 void* this_arg_ptr = untag_ptr(this_arg);
13858 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13859 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13860 LDKPublicKey their_node_id_ref;
13861 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13862 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13863 LDKOpenChannel msg_conv;
13864 msg_conv.inner = untag_ptr(msg);
13865 msg_conv.is_owned = ptr_is_owned(msg);
13866 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13867 msg_conv.is_owned = false;
13868 (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13871 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) {
13872 void* this_arg_ptr = untag_ptr(this_arg);
13873 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13874 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13875 LDKPublicKey their_node_id_ref;
13876 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13877 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13878 LDKAcceptChannel msg_conv;
13879 msg_conv.inner = untag_ptr(msg);
13880 msg_conv.is_owned = ptr_is_owned(msg);
13881 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13882 msg_conv.is_owned = false;
13883 (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13886 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) {
13887 void* this_arg_ptr = untag_ptr(this_arg);
13888 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13889 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13890 LDKPublicKey their_node_id_ref;
13891 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13892 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13893 LDKFundingCreated msg_conv;
13894 msg_conv.inner = untag_ptr(msg);
13895 msg_conv.is_owned = ptr_is_owned(msg);
13896 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13897 msg_conv.is_owned = false;
13898 (this_arg_conv->handle_funding_created)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13901 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) {
13902 void* this_arg_ptr = untag_ptr(this_arg);
13903 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13904 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13905 LDKPublicKey their_node_id_ref;
13906 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13907 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13908 LDKFundingSigned msg_conv;
13909 msg_conv.inner = untag_ptr(msg);
13910 msg_conv.is_owned = ptr_is_owned(msg);
13911 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13912 msg_conv.is_owned = false;
13913 (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13916 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) {
13917 void* this_arg_ptr = untag_ptr(this_arg);
13918 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13919 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13920 LDKPublicKey their_node_id_ref;
13921 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13922 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13923 LDKChannelReady msg_conv;
13924 msg_conv.inner = untag_ptr(msg);
13925 msg_conv.is_owned = ptr_is_owned(msg);
13926 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13927 msg_conv.is_owned = false;
13928 (this_arg_conv->handle_channel_ready)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13931 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) {
13932 void* this_arg_ptr = untag_ptr(this_arg);
13933 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13934 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13935 LDKPublicKey their_node_id_ref;
13936 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13937 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13938 LDKShutdown msg_conv;
13939 msg_conv.inner = untag_ptr(msg);
13940 msg_conv.is_owned = ptr_is_owned(msg);
13941 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13942 msg_conv.is_owned = false;
13943 (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13946 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) {
13947 void* this_arg_ptr = untag_ptr(this_arg);
13948 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13949 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13950 LDKPublicKey their_node_id_ref;
13951 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13952 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13953 LDKClosingSigned msg_conv;
13954 msg_conv.inner = untag_ptr(msg);
13955 msg_conv.is_owned = ptr_is_owned(msg);
13956 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13957 msg_conv.is_owned = false;
13958 (this_arg_conv->handle_closing_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13961 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) {
13962 void* this_arg_ptr = untag_ptr(this_arg);
13963 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13964 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13965 LDKPublicKey their_node_id_ref;
13966 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13967 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13968 LDKUpdateAddHTLC msg_conv;
13969 msg_conv.inner = untag_ptr(msg);
13970 msg_conv.is_owned = ptr_is_owned(msg);
13971 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13972 msg_conv.is_owned = false;
13973 (this_arg_conv->handle_update_add_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13976 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) {
13977 void* this_arg_ptr = untag_ptr(this_arg);
13978 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13979 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13980 LDKPublicKey their_node_id_ref;
13981 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13982 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13983 LDKUpdateFulfillHTLC msg_conv;
13984 msg_conv.inner = untag_ptr(msg);
13985 msg_conv.is_owned = ptr_is_owned(msg);
13986 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
13987 msg_conv.is_owned = false;
13988 (this_arg_conv->handle_update_fulfill_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
13991 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) {
13992 void* this_arg_ptr = untag_ptr(this_arg);
13993 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
13994 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
13995 LDKPublicKey their_node_id_ref;
13996 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
13997 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
13998 LDKUpdateFailHTLC msg_conv;
13999 msg_conv.inner = untag_ptr(msg);
14000 msg_conv.is_owned = ptr_is_owned(msg);
14001 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14002 msg_conv.is_owned = false;
14003 (this_arg_conv->handle_update_fail_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
14006 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) {
14007 void* this_arg_ptr = untag_ptr(this_arg);
14008 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14009 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
14010 LDKPublicKey their_node_id_ref;
14011 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14012 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14013 LDKUpdateFailMalformedHTLC msg_conv;
14014 msg_conv.inner = untag_ptr(msg);
14015 msg_conv.is_owned = ptr_is_owned(msg);
14016 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14017 msg_conv.is_owned = false;
14018 (this_arg_conv->handle_update_fail_malformed_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
14021 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) {
14022 void* this_arg_ptr = untag_ptr(this_arg);
14023 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14024 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
14025 LDKPublicKey their_node_id_ref;
14026 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14027 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14028 LDKCommitmentSigned msg_conv;
14029 msg_conv.inner = untag_ptr(msg);
14030 msg_conv.is_owned = ptr_is_owned(msg);
14031 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14032 msg_conv.is_owned = false;
14033 (this_arg_conv->handle_commitment_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
14036 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) {
14037 void* this_arg_ptr = untag_ptr(this_arg);
14038 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14039 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
14040 LDKPublicKey their_node_id_ref;
14041 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14042 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14043 LDKRevokeAndACK msg_conv;
14044 msg_conv.inner = untag_ptr(msg);
14045 msg_conv.is_owned = ptr_is_owned(msg);
14046 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14047 msg_conv.is_owned = false;
14048 (this_arg_conv->handle_revoke_and_ack)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
14051 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) {
14052 void* this_arg_ptr = untag_ptr(this_arg);
14053 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14054 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
14055 LDKPublicKey their_node_id_ref;
14056 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14057 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14058 LDKUpdateFee msg_conv;
14059 msg_conv.inner = untag_ptr(msg);
14060 msg_conv.is_owned = ptr_is_owned(msg);
14061 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14062 msg_conv.is_owned = false;
14063 (this_arg_conv->handle_update_fee)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
14066 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) {
14067 void* this_arg_ptr = untag_ptr(this_arg);
14068 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14069 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
14070 LDKPublicKey their_node_id_ref;
14071 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14072 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14073 LDKAnnouncementSignatures msg_conv;
14074 msg_conv.inner = untag_ptr(msg);
14075 msg_conv.is_owned = ptr_is_owned(msg);
14076 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14077 msg_conv.is_owned = false;
14078 (this_arg_conv->handle_announcement_signatures)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
14081 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id) {
14082 void* this_arg_ptr = untag_ptr(this_arg);
14083 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14084 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
14085 LDKPublicKey their_node_id_ref;
14086 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14087 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14088 (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref);
14091 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) {
14092 void* this_arg_ptr = untag_ptr(this_arg);
14093 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14094 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
14095 LDKPublicKey their_node_id_ref;
14096 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14097 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14099 msg_conv.inner = untag_ptr(msg);
14100 msg_conv.is_owned = ptr_is_owned(msg);
14101 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14102 msg_conv.is_owned = false;
14103 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
14104 *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv, inbound);
14105 return tag_ptr(ret_conv, true);
14108 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) {
14109 void* this_arg_ptr = untag_ptr(this_arg);
14110 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14111 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
14112 LDKPublicKey their_node_id_ref;
14113 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14114 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14115 LDKChannelReestablish msg_conv;
14116 msg_conv.inner = untag_ptr(msg);
14117 msg_conv.is_owned = ptr_is_owned(msg);
14118 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14119 msg_conv.is_owned = false;
14120 (this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
14123 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) {
14124 void* this_arg_ptr = untag_ptr(this_arg);
14125 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14126 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
14127 LDKPublicKey their_node_id_ref;
14128 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14129 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14130 LDKChannelUpdate msg_conv;
14131 msg_conv.inner = untag_ptr(msg);
14132 msg_conv.is_owned = ptr_is_owned(msg);
14133 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14134 msg_conv.is_owned = false;
14135 (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
14138 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) {
14139 void* this_arg_ptr = untag_ptr(this_arg);
14140 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14141 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
14142 LDKPublicKey their_node_id_ref;
14143 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14144 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14145 LDKErrorMessage msg_conv;
14146 msg_conv.inner = untag_ptr(msg);
14147 msg_conv.is_owned = ptr_is_owned(msg);
14148 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14149 msg_conv.is_owned = false;
14150 (this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
14153 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1provided_1node_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
14154 void* this_arg_ptr = untag_ptr(this_arg);
14155 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14156 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
14157 LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg);
14158 int64_t ret_ref = 0;
14159 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
14160 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
14164 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) {
14165 void* this_arg_ptr = untag_ptr(this_arg);
14166 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14167 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
14168 LDKPublicKey their_node_id_ref;
14169 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14170 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14171 LDKInitFeatures ret_var = (this_arg_conv->provided_init_features)(this_arg_conv->this_arg, their_node_id_ref);
14172 int64_t ret_ref = 0;
14173 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
14174 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
14178 typedef struct LDKRoutingMessageHandler_JCalls {
14179 atomic_size_t refcnt;
14182 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
14183 jmethodID handle_node_announcement_meth;
14184 jmethodID handle_channel_announcement_meth;
14185 jmethodID handle_channel_update_meth;
14186 jmethodID get_next_channel_announcement_meth;
14187 jmethodID get_next_node_announcement_meth;
14188 jmethodID peer_connected_meth;
14189 jmethodID handle_reply_channel_range_meth;
14190 jmethodID handle_reply_short_channel_ids_end_meth;
14191 jmethodID handle_query_channel_range_meth;
14192 jmethodID handle_query_short_channel_ids_meth;
14193 jmethodID processing_queue_high_meth;
14194 jmethodID provided_node_features_meth;
14195 jmethodID provided_init_features_meth;
14196 } LDKRoutingMessageHandler_JCalls;
14197 static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
14198 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14199 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
14201 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14202 if (get_jenv_res == JNI_EDETACHED) {
14203 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14205 DO_ASSERT(get_jenv_res == JNI_OK);
14207 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
14208 if (get_jenv_res == JNI_EDETACHED) {
14209 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14214 LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) {
14215 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14217 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14218 if (get_jenv_res == JNI_EDETACHED) {
14219 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14221 DO_ASSERT(get_jenv_res == JNI_OK);
14223 LDKNodeAnnouncement msg_var = *msg;
14224 int64_t msg_ref = 0;
14225 msg_var = NodeAnnouncement_clone(&msg_var);
14226 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
14227 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
14228 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14229 CHECK(obj != NULL);
14230 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_node_announcement_meth, msg_ref);
14231 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14232 (*env)->ExceptionDescribe(env);
14233 (*env)->FatalError(env, "A call to handle_node_announcement in LDKRoutingMessageHandler from rust threw an exception.");
14235 void* ret_ptr = untag_ptr(ret);
14236 CHECK_ACCESS(ret_ptr);
14237 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
14238 FREE(untag_ptr(ret));
14239 if (get_jenv_res == JNI_EDETACHED) {
14240 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14244 LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) {
14245 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14247 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14248 if (get_jenv_res == JNI_EDETACHED) {
14249 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14251 DO_ASSERT(get_jenv_res == JNI_OK);
14253 LDKChannelAnnouncement msg_var = *msg;
14254 int64_t msg_ref = 0;
14255 msg_var = ChannelAnnouncement_clone(&msg_var);
14256 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
14257 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
14258 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14259 CHECK(obj != NULL);
14260 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_announcement_meth, msg_ref);
14261 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14262 (*env)->ExceptionDescribe(env);
14263 (*env)->FatalError(env, "A call to handle_channel_announcement in LDKRoutingMessageHandler from rust threw an exception.");
14265 void* ret_ptr = untag_ptr(ret);
14266 CHECK_ACCESS(ret_ptr);
14267 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
14268 FREE(untag_ptr(ret));
14269 if (get_jenv_res == JNI_EDETACHED) {
14270 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14274 LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelUpdate * msg) {
14275 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14277 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14278 if (get_jenv_res == JNI_EDETACHED) {
14279 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14281 DO_ASSERT(get_jenv_res == JNI_OK);
14283 LDKChannelUpdate msg_var = *msg;
14284 int64_t msg_ref = 0;
14285 msg_var = ChannelUpdate_clone(&msg_var);
14286 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
14287 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
14288 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14289 CHECK(obj != NULL);
14290 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_channel_update_meth, msg_ref);
14291 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14292 (*env)->ExceptionDescribe(env);
14293 (*env)->FatalError(env, "A call to handle_channel_update in LDKRoutingMessageHandler from rust threw an exception.");
14295 void* ret_ptr = untag_ptr(ret);
14296 CHECK_ACCESS(ret_ptr);
14297 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
14298 FREE(untag_ptr(ret));
14299 if (get_jenv_res == JNI_EDETACHED) {
14300 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14304 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, uint64_t starting_point) {
14305 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14307 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14308 if (get_jenv_res == JNI_EDETACHED) {
14309 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14311 DO_ASSERT(get_jenv_res == JNI_OK);
14313 int64_t starting_point_conv = starting_point;
14314 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14315 CHECK(obj != NULL);
14316 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_next_channel_announcement_meth, starting_point_conv);
14317 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14318 (*env)->ExceptionDescribe(env);
14319 (*env)->FatalError(env, "A call to get_next_channel_announcement in LDKRoutingMessageHandler from rust threw an exception.");
14321 void* ret_ptr = untag_ptr(ret);
14322 CHECK_ACCESS(ret_ptr);
14323 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_conv = *(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(ret_ptr);
14324 FREE(untag_ptr(ret));
14325 if (get_jenv_res == JNI_EDETACHED) {
14326 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14330 LDKNodeAnnouncement get_next_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKNodeId starting_point) {
14331 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14333 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14334 if (get_jenv_res == JNI_EDETACHED) {
14335 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14337 DO_ASSERT(get_jenv_res == JNI_OK);
14339 LDKNodeId starting_point_var = starting_point;
14340 int64_t starting_point_ref = 0;
14341 CHECK_INNER_FIELD_ACCESS_OR_NULL(starting_point_var);
14342 starting_point_ref = tag_ptr(starting_point_var.inner, starting_point_var.is_owned);
14343 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14344 CHECK(obj != NULL);
14345 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_next_node_announcement_meth, starting_point_ref);
14346 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14347 (*env)->ExceptionDescribe(env);
14348 (*env)->FatalError(env, "A call to get_next_node_announcement in LDKRoutingMessageHandler from rust threw an exception.");
14350 LDKNodeAnnouncement ret_conv;
14351 ret_conv.inner = untag_ptr(ret);
14352 ret_conv.is_owned = ptr_is_owned(ret);
14353 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
14354 if (get_jenv_res == JNI_EDETACHED) {
14355 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14359 LDKCResult_NoneNoneZ peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init, bool inbound) {
14360 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14362 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14363 if (get_jenv_res == JNI_EDETACHED) {
14364 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14366 DO_ASSERT(get_jenv_res == JNI_OK);
14368 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
14369 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
14370 LDKInit init_var = *init;
14371 int64_t init_ref = 0;
14372 init_var = Init_clone(&init_var);
14373 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var);
14374 init_ref = tag_ptr(init_var.inner, init_var.is_owned);
14375 jboolean inbound_conv = inbound;
14376 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14377 CHECK(obj != NULL);
14378 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, init_ref, inbound_conv);
14379 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14380 (*env)->ExceptionDescribe(env);
14381 (*env)->FatalError(env, "A call to peer_connected in LDKRoutingMessageHandler from rust threw an exception.");
14383 void* ret_ptr = untag_ptr(ret);
14384 CHECK_ACCESS(ret_ptr);
14385 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
14386 FREE(untag_ptr(ret));
14387 if (get_jenv_res == JNI_EDETACHED) {
14388 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14392 LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
14393 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14395 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14396 if (get_jenv_res == JNI_EDETACHED) {
14397 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14399 DO_ASSERT(get_jenv_res == JNI_OK);
14401 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
14402 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
14403 LDKReplyChannelRange msg_var = msg;
14404 int64_t msg_ref = 0;
14405 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
14406 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
14407 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14408 CHECK(obj != NULL);
14409 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_reply_channel_range_meth, their_node_id_arr, msg_ref);
14410 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14411 (*env)->ExceptionDescribe(env);
14412 (*env)->FatalError(env, "A call to handle_reply_channel_range in LDKRoutingMessageHandler from rust threw an exception.");
14414 void* ret_ptr = untag_ptr(ret);
14415 CHECK_ACCESS(ret_ptr);
14416 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
14417 FREE(untag_ptr(ret));
14418 if (get_jenv_res == JNI_EDETACHED) {
14419 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14423 LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) {
14424 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14426 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14427 if (get_jenv_res == JNI_EDETACHED) {
14428 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14430 DO_ASSERT(get_jenv_res == JNI_OK);
14432 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
14433 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
14434 LDKReplyShortChannelIdsEnd msg_var = msg;
14435 int64_t msg_ref = 0;
14436 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
14437 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
14438 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14439 CHECK(obj != NULL);
14440 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_reply_short_channel_ids_end_meth, their_node_id_arr, msg_ref);
14441 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14442 (*env)->ExceptionDescribe(env);
14443 (*env)->FatalError(env, "A call to handle_reply_short_channel_ids_end in LDKRoutingMessageHandler from rust threw an exception.");
14445 void* ret_ptr = untag_ptr(ret);
14446 CHECK_ACCESS(ret_ptr);
14447 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
14448 FREE(untag_ptr(ret));
14449 if (get_jenv_res == JNI_EDETACHED) {
14450 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14454 LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) {
14455 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14457 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14458 if (get_jenv_res == JNI_EDETACHED) {
14459 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14461 DO_ASSERT(get_jenv_res == JNI_OK);
14463 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
14464 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
14465 LDKQueryChannelRange msg_var = msg;
14466 int64_t msg_ref = 0;
14467 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
14468 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
14469 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14470 CHECK(obj != NULL);
14471 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_query_channel_range_meth, their_node_id_arr, msg_ref);
14472 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14473 (*env)->ExceptionDescribe(env);
14474 (*env)->FatalError(env, "A call to handle_query_channel_range in LDKRoutingMessageHandler from rust threw an exception.");
14476 void* ret_ptr = untag_ptr(ret);
14477 CHECK_ACCESS(ret_ptr);
14478 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
14479 FREE(untag_ptr(ret));
14480 if (get_jenv_res == JNI_EDETACHED) {
14481 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14485 LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) {
14486 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14488 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14489 if (get_jenv_res == JNI_EDETACHED) {
14490 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14492 DO_ASSERT(get_jenv_res == JNI_OK);
14494 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
14495 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
14496 LDKQueryShortChannelIds msg_var = msg;
14497 int64_t msg_ref = 0;
14498 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
14499 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
14500 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14501 CHECK(obj != NULL);
14502 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_query_short_channel_ids_meth, their_node_id_arr, msg_ref);
14503 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14504 (*env)->ExceptionDescribe(env);
14505 (*env)->FatalError(env, "A call to handle_query_short_channel_ids in LDKRoutingMessageHandler from rust threw an exception.");
14507 void* ret_ptr = untag_ptr(ret);
14508 CHECK_ACCESS(ret_ptr);
14509 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
14510 FREE(untag_ptr(ret));
14511 if (get_jenv_res == JNI_EDETACHED) {
14512 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14516 bool processing_queue_high_LDKRoutingMessageHandler_jcall(const void* this_arg) {
14517 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14519 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14520 if (get_jenv_res == JNI_EDETACHED) {
14521 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14523 DO_ASSERT(get_jenv_res == JNI_OK);
14525 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14526 CHECK(obj != NULL);
14527 jboolean ret = (*env)->CallBooleanMethod(env, obj, j_calls->processing_queue_high_meth);
14528 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14529 (*env)->ExceptionDescribe(env);
14530 (*env)->FatalError(env, "A call to processing_queue_high in LDKRoutingMessageHandler from rust threw an exception.");
14532 if (get_jenv_res == JNI_EDETACHED) {
14533 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14537 LDKNodeFeatures provided_node_features_LDKRoutingMessageHandler_jcall(const void* this_arg) {
14538 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14540 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14541 if (get_jenv_res == JNI_EDETACHED) {
14542 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14544 DO_ASSERT(get_jenv_res == JNI_OK);
14546 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14547 CHECK(obj != NULL);
14548 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_node_features_meth);
14549 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14550 (*env)->ExceptionDescribe(env);
14551 (*env)->FatalError(env, "A call to provided_node_features in LDKRoutingMessageHandler from rust threw an exception.");
14553 LDKNodeFeatures ret_conv;
14554 ret_conv.inner = untag_ptr(ret);
14555 ret_conv.is_owned = ptr_is_owned(ret);
14556 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
14557 if (get_jenv_res == JNI_EDETACHED) {
14558 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14562 LDKInitFeatures provided_init_features_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
14563 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
14565 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14566 if (get_jenv_res == JNI_EDETACHED) {
14567 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14569 DO_ASSERT(get_jenv_res == JNI_OK);
14571 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
14572 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
14573 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14574 CHECK(obj != NULL);
14575 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_init_features_meth, their_node_id_arr);
14576 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14577 (*env)->ExceptionDescribe(env);
14578 (*env)->FatalError(env, "A call to provided_init_features in LDKRoutingMessageHandler from rust threw an exception.");
14580 LDKInitFeatures ret_conv;
14581 ret_conv.inner = untag_ptr(ret);
14582 ret_conv.is_owned = ptr_is_owned(ret);
14583 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
14584 if (get_jenv_res == JNI_EDETACHED) {
14585 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14589 static void LDKRoutingMessageHandler_JCalls_cloned(LDKRoutingMessageHandler* new_obj) {
14590 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) new_obj->this_arg;
14591 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
14592 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
14594 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
14595 jclass c = (*env)->GetObjectClass(env, o);
14597 LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
14598 atomic_init(&calls->refcnt, 1);
14599 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
14600 calls->o = (*env)->NewWeakGlobalRef(env, o);
14601 calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "(J)J");
14602 CHECK(calls->handle_node_announcement_meth != NULL);
14603 calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "(J)J");
14604 CHECK(calls->handle_channel_announcement_meth != NULL);
14605 calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "(J)J");
14606 CHECK(calls->handle_channel_update_meth != NULL);
14607 calls->get_next_channel_announcement_meth = (*env)->GetMethodID(env, c, "get_next_channel_announcement", "(J)J");
14608 CHECK(calls->get_next_channel_announcement_meth != NULL);
14609 calls->get_next_node_announcement_meth = (*env)->GetMethodID(env, c, "get_next_node_announcement", "(J)J");
14610 CHECK(calls->get_next_node_announcement_meth != NULL);
14611 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJZ)J");
14612 CHECK(calls->peer_connected_meth != NULL);
14613 calls->handle_reply_channel_range_meth = (*env)->GetMethodID(env, c, "handle_reply_channel_range", "([BJ)J");
14614 CHECK(calls->handle_reply_channel_range_meth != NULL);
14615 calls->handle_reply_short_channel_ids_end_meth = (*env)->GetMethodID(env, c, "handle_reply_short_channel_ids_end", "([BJ)J");
14616 CHECK(calls->handle_reply_short_channel_ids_end_meth != NULL);
14617 calls->handle_query_channel_range_meth = (*env)->GetMethodID(env, c, "handle_query_channel_range", "([BJ)J");
14618 CHECK(calls->handle_query_channel_range_meth != NULL);
14619 calls->handle_query_short_channel_ids_meth = (*env)->GetMethodID(env, c, "handle_query_short_channel_ids", "([BJ)J");
14620 CHECK(calls->handle_query_short_channel_ids_meth != NULL);
14621 calls->processing_queue_high_meth = (*env)->GetMethodID(env, c, "processing_queue_high", "()Z");
14622 CHECK(calls->processing_queue_high_meth != NULL);
14623 calls->provided_node_features_meth = (*env)->GetMethodID(env, c, "provided_node_features", "()J");
14624 CHECK(calls->provided_node_features_meth != NULL);
14625 calls->provided_init_features_meth = (*env)->GetMethodID(env, c, "provided_init_features", "([B)J");
14626 CHECK(calls->provided_init_features_meth != NULL);
14628 LDKRoutingMessageHandler ret = {
14629 .this_arg = (void*) calls,
14630 .handle_node_announcement = handle_node_announcement_LDKRoutingMessageHandler_jcall,
14631 .handle_channel_announcement = handle_channel_announcement_LDKRoutingMessageHandler_jcall,
14632 .handle_channel_update = handle_channel_update_LDKRoutingMessageHandler_jcall,
14633 .get_next_channel_announcement = get_next_channel_announcement_LDKRoutingMessageHandler_jcall,
14634 .get_next_node_announcement = get_next_node_announcement_LDKRoutingMessageHandler_jcall,
14635 .peer_connected = peer_connected_LDKRoutingMessageHandler_jcall,
14636 .handle_reply_channel_range = handle_reply_channel_range_LDKRoutingMessageHandler_jcall,
14637 .handle_reply_short_channel_ids_end = handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall,
14638 .handle_query_channel_range = handle_query_channel_range_LDKRoutingMessageHandler_jcall,
14639 .handle_query_short_channel_ids = handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall,
14640 .processing_queue_high = processing_queue_high_LDKRoutingMessageHandler_jcall,
14641 .provided_node_features = provided_node_features_LDKRoutingMessageHandler_jcall,
14642 .provided_init_features = provided_init_features_LDKRoutingMessageHandler_jcall,
14643 .free = LDKRoutingMessageHandler_JCalls_free,
14644 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, clz, MessageSendEventsProvider),
14646 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
14649 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new(JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
14650 LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
14651 *res_ptr = LDKRoutingMessageHandler_init(env, clz, o, MessageSendEventsProvider);
14652 return tag_ptr(res_ptr, true);
14654 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t arg) {
14655 LDKRoutingMessageHandler *inp = (LDKRoutingMessageHandler *)untag_ptr(arg);
14656 return tag_ptr(&inp->MessageSendEventsProvider, false);
14658 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
14659 void* this_arg_ptr = untag_ptr(this_arg);
14660 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14661 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14662 LDKNodeAnnouncement msg_conv;
14663 msg_conv.inner = untag_ptr(msg);
14664 msg_conv.is_owned = ptr_is_owned(msg);
14665 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14666 msg_conv.is_owned = false;
14667 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
14668 *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv);
14669 return tag_ptr(ret_conv, true);
14672 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
14673 void* this_arg_ptr = untag_ptr(this_arg);
14674 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14675 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14676 LDKChannelAnnouncement msg_conv;
14677 msg_conv.inner = untag_ptr(msg);
14678 msg_conv.is_owned = ptr_is_owned(msg);
14679 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14680 msg_conv.is_owned = false;
14681 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
14682 *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
14683 return tag_ptr(ret_conv, true);
14686 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1channel_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
14687 void* this_arg_ptr = untag_ptr(this_arg);
14688 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14689 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14690 LDKChannelUpdate msg_conv;
14691 msg_conv.inner = untag_ptr(msg);
14692 msg_conv.is_owned = ptr_is_owned(msg);
14693 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14694 msg_conv.is_owned = false;
14695 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
14696 *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv);
14697 return tag_ptr(ret_conv, true);
14700 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) {
14701 void* this_arg_ptr = untag_ptr(this_arg);
14702 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14703 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14704 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
14705 *ret_copy = (this_arg_conv->get_next_channel_announcement)(this_arg_conv->this_arg, starting_point);
14706 int64_t ret_ref = tag_ptr(ret_copy, true);
14710 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) {
14711 void* this_arg_ptr = untag_ptr(this_arg);
14712 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14713 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14714 LDKNodeId starting_point_conv;
14715 starting_point_conv.inner = untag_ptr(starting_point);
14716 starting_point_conv.is_owned = ptr_is_owned(starting_point);
14717 CHECK_INNER_FIELD_ACCESS_OR_NULL(starting_point_conv);
14718 starting_point_conv = NodeId_clone(&starting_point_conv);
14719 LDKNodeAnnouncement ret_var = (this_arg_conv->get_next_node_announcement)(this_arg_conv->this_arg, starting_point_conv);
14720 int64_t ret_ref = 0;
14721 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
14722 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
14726 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) {
14727 void* this_arg_ptr = untag_ptr(this_arg);
14728 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14729 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14730 LDKPublicKey their_node_id_ref;
14731 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14732 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14734 init_conv.inner = untag_ptr(init);
14735 init_conv.is_owned = ptr_is_owned(init);
14736 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
14737 init_conv.is_owned = false;
14738 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
14739 *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv, inbound);
14740 return tag_ptr(ret_conv, true);
14743 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) {
14744 void* this_arg_ptr = untag_ptr(this_arg);
14745 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14746 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14747 LDKPublicKey their_node_id_ref;
14748 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14749 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14750 LDKReplyChannelRange msg_conv;
14751 msg_conv.inner = untag_ptr(msg);
14752 msg_conv.is_owned = ptr_is_owned(msg);
14753 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14754 msg_conv = ReplyChannelRange_clone(&msg_conv);
14755 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
14756 *ret_conv = (this_arg_conv->handle_reply_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
14757 return tag_ptr(ret_conv, true);
14760 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) {
14761 void* this_arg_ptr = untag_ptr(this_arg);
14762 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14763 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14764 LDKPublicKey their_node_id_ref;
14765 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14766 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14767 LDKReplyShortChannelIdsEnd msg_conv;
14768 msg_conv.inner = untag_ptr(msg);
14769 msg_conv.is_owned = ptr_is_owned(msg);
14770 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14771 msg_conv = ReplyShortChannelIdsEnd_clone(&msg_conv);
14772 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
14773 *ret_conv = (this_arg_conv->handle_reply_short_channel_ids_end)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
14774 return tag_ptr(ret_conv, true);
14777 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) {
14778 void* this_arg_ptr = untag_ptr(this_arg);
14779 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14780 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14781 LDKPublicKey their_node_id_ref;
14782 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14783 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14784 LDKQueryChannelRange msg_conv;
14785 msg_conv.inner = untag_ptr(msg);
14786 msg_conv.is_owned = ptr_is_owned(msg);
14787 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14788 msg_conv = QueryChannelRange_clone(&msg_conv);
14789 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
14790 *ret_conv = (this_arg_conv->handle_query_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
14791 return tag_ptr(ret_conv, true);
14794 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) {
14795 void* this_arg_ptr = untag_ptr(this_arg);
14796 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14797 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14798 LDKPublicKey their_node_id_ref;
14799 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14800 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14801 LDKQueryShortChannelIds msg_conv;
14802 msg_conv.inner = untag_ptr(msg);
14803 msg_conv.is_owned = ptr_is_owned(msg);
14804 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
14805 msg_conv = QueryShortChannelIds_clone(&msg_conv);
14806 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
14807 *ret_conv = (this_arg_conv->handle_query_short_channel_ids)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
14808 return tag_ptr(ret_conv, true);
14811 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1processing_1queue_1high(JNIEnv *env, jclass clz, int64_t this_arg) {
14812 void* this_arg_ptr = untag_ptr(this_arg);
14813 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14814 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14815 jboolean ret_conv = (this_arg_conv->processing_queue_high)(this_arg_conv->this_arg);
14819 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1provided_1node_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
14820 void* this_arg_ptr = untag_ptr(this_arg);
14821 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14822 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14823 LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg);
14824 int64_t ret_ref = 0;
14825 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
14826 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
14830 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) {
14831 void* this_arg_ptr = untag_ptr(this_arg);
14832 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14833 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
14834 LDKPublicKey their_node_id_ref;
14835 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
14836 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
14837 LDKInitFeatures ret_var = (this_arg_conv->provided_init_features)(this_arg_conv->this_arg, their_node_id_ref);
14838 int64_t ret_ref = 0;
14839 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
14840 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
14844 typedef struct LDKOnionMessageProvider_JCalls {
14845 atomic_size_t refcnt;
14848 jmethodID next_onion_message_for_peer_meth;
14849 } LDKOnionMessageProvider_JCalls;
14850 static void LDKOnionMessageProvider_JCalls_free(void* this_arg) {
14851 LDKOnionMessageProvider_JCalls *j_calls = (LDKOnionMessageProvider_JCalls*) this_arg;
14852 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
14854 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14855 if (get_jenv_res == JNI_EDETACHED) {
14856 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14858 DO_ASSERT(get_jenv_res == JNI_OK);
14860 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
14861 if (get_jenv_res == JNI_EDETACHED) {
14862 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14867 LDKOnionMessage next_onion_message_for_peer_LDKOnionMessageProvider_jcall(const void* this_arg, LDKPublicKey peer_node_id) {
14868 LDKOnionMessageProvider_JCalls *j_calls = (LDKOnionMessageProvider_JCalls*) this_arg;
14870 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14871 if (get_jenv_res == JNI_EDETACHED) {
14872 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14874 DO_ASSERT(get_jenv_res == JNI_OK);
14876 int8_tArray peer_node_id_arr = (*env)->NewByteArray(env, 33);
14877 (*env)->SetByteArrayRegion(env, peer_node_id_arr, 0, 33, peer_node_id.compressed_form);
14878 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14879 CHECK(obj != NULL);
14880 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->next_onion_message_for_peer_meth, peer_node_id_arr);
14881 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14882 (*env)->ExceptionDescribe(env);
14883 (*env)->FatalError(env, "A call to next_onion_message_for_peer in LDKOnionMessageProvider from rust threw an exception.");
14885 LDKOnionMessage ret_conv;
14886 ret_conv.inner = untag_ptr(ret);
14887 ret_conv.is_owned = ptr_is_owned(ret);
14888 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
14889 if (get_jenv_res == JNI_EDETACHED) {
14890 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14894 static void LDKOnionMessageProvider_JCalls_cloned(LDKOnionMessageProvider* new_obj) {
14895 LDKOnionMessageProvider_JCalls *j_calls = (LDKOnionMessageProvider_JCalls*) new_obj->this_arg;
14896 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
14898 static inline LDKOnionMessageProvider LDKOnionMessageProvider_init (JNIEnv *env, jclass clz, jobject o) {
14899 jclass c = (*env)->GetObjectClass(env, o);
14901 LDKOnionMessageProvider_JCalls *calls = MALLOC(sizeof(LDKOnionMessageProvider_JCalls), "LDKOnionMessageProvider_JCalls");
14902 atomic_init(&calls->refcnt, 1);
14903 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
14904 calls->o = (*env)->NewWeakGlobalRef(env, o);
14905 calls->next_onion_message_for_peer_meth = (*env)->GetMethodID(env, c, "next_onion_message_for_peer", "([B)J");
14906 CHECK(calls->next_onion_message_for_peer_meth != NULL);
14908 LDKOnionMessageProvider ret = {
14909 .this_arg = (void*) calls,
14910 .next_onion_message_for_peer = next_onion_message_for_peer_LDKOnionMessageProvider_jcall,
14911 .free = LDKOnionMessageProvider_JCalls_free,
14915 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKOnionMessageProvider_1new(JNIEnv *env, jclass clz, jobject o) {
14916 LDKOnionMessageProvider *res_ptr = MALLOC(sizeof(LDKOnionMessageProvider), "LDKOnionMessageProvider");
14917 *res_ptr = LDKOnionMessageProvider_init(env, clz, o);
14918 return tag_ptr(res_ptr, true);
14920 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) {
14921 void* this_arg_ptr = untag_ptr(this_arg);
14922 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
14923 LDKOnionMessageProvider* this_arg_conv = (LDKOnionMessageProvider*)this_arg_ptr;
14924 LDKPublicKey peer_node_id_ref;
14925 CHECK((*env)->GetArrayLength(env, peer_node_id) == 33);
14926 (*env)->GetByteArrayRegion(env, peer_node_id, 0, 33, peer_node_id_ref.compressed_form);
14927 LDKOnionMessage ret_var = (this_arg_conv->next_onion_message_for_peer)(this_arg_conv->this_arg, peer_node_id_ref);
14928 int64_t ret_ref = 0;
14929 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
14930 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
14934 typedef struct LDKOnionMessageHandler_JCalls {
14935 atomic_size_t refcnt;
14938 LDKOnionMessageProvider_JCalls* OnionMessageProvider;
14939 jmethodID handle_onion_message_meth;
14940 jmethodID peer_connected_meth;
14941 jmethodID peer_disconnected_meth;
14942 jmethodID provided_node_features_meth;
14943 jmethodID provided_init_features_meth;
14944 } LDKOnionMessageHandler_JCalls;
14945 static void LDKOnionMessageHandler_JCalls_free(void* this_arg) {
14946 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
14947 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
14949 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14950 if (get_jenv_res == JNI_EDETACHED) {
14951 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14953 DO_ASSERT(get_jenv_res == JNI_OK);
14955 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
14956 if (get_jenv_res == JNI_EDETACHED) {
14957 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14962 void handle_onion_message_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey peer_node_id, const LDKOnionMessage * msg) {
14963 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
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 int8_tArray peer_node_id_arr = (*env)->NewByteArray(env, 33);
14972 (*env)->SetByteArrayRegion(env, peer_node_id_arr, 0, 33, peer_node_id.compressed_form);
14973 LDKOnionMessage msg_var = *msg;
14974 int64_t msg_ref = 0;
14975 msg_var = OnionMessage_clone(&msg_var);
14976 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
14977 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
14978 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
14979 CHECK(obj != NULL);
14980 (*env)->CallVoidMethod(env, obj, j_calls->handle_onion_message_meth, peer_node_id_arr, msg_ref);
14981 if (UNLIKELY((*env)->ExceptionCheck(env))) {
14982 (*env)->ExceptionDescribe(env);
14983 (*env)->FatalError(env, "A call to handle_onion_message in LDKOnionMessageHandler from rust threw an exception.");
14985 if (get_jenv_res == JNI_EDETACHED) {
14986 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
14989 LDKCResult_NoneNoneZ peer_connected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init, bool inbound) {
14990 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
14992 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
14993 if (get_jenv_res == JNI_EDETACHED) {
14994 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
14996 DO_ASSERT(get_jenv_res == JNI_OK);
14998 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
14999 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
15000 LDKInit init_var = *init;
15001 int64_t init_ref = 0;
15002 init_var = Init_clone(&init_var);
15003 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var);
15004 init_ref = tag_ptr(init_var.inner, init_var.is_owned);
15005 jboolean inbound_conv = inbound;
15006 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15007 CHECK(obj != NULL);
15008 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, init_ref, inbound_conv);
15009 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15010 (*env)->ExceptionDescribe(env);
15011 (*env)->FatalError(env, "A call to peer_connected in LDKOnionMessageHandler from rust threw an exception.");
15013 void* ret_ptr = untag_ptr(ret);
15014 CHECK_ACCESS(ret_ptr);
15015 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
15016 FREE(untag_ptr(ret));
15017 if (get_jenv_res == JNI_EDETACHED) {
15018 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15022 void peer_disconnected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
15023 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
15025 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15026 if (get_jenv_res == JNI_EDETACHED) {
15027 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15029 DO_ASSERT(get_jenv_res == JNI_OK);
15031 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
15032 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
15033 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15034 CHECK(obj != NULL);
15035 (*env)->CallVoidMethod(env, obj, j_calls->peer_disconnected_meth, their_node_id_arr);
15036 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15037 (*env)->ExceptionDescribe(env);
15038 (*env)->FatalError(env, "A call to peer_disconnected in LDKOnionMessageHandler from rust threw an exception.");
15040 if (get_jenv_res == JNI_EDETACHED) {
15041 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15044 LDKNodeFeatures provided_node_features_LDKOnionMessageHandler_jcall(const void* this_arg) {
15045 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
15047 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15048 if (get_jenv_res == JNI_EDETACHED) {
15049 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15051 DO_ASSERT(get_jenv_res == JNI_OK);
15053 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15054 CHECK(obj != NULL);
15055 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_node_features_meth);
15056 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15057 (*env)->ExceptionDescribe(env);
15058 (*env)->FatalError(env, "A call to provided_node_features in LDKOnionMessageHandler from rust threw an exception.");
15060 LDKNodeFeatures ret_conv;
15061 ret_conv.inner = untag_ptr(ret);
15062 ret_conv.is_owned = ptr_is_owned(ret);
15063 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
15064 if (get_jenv_res == JNI_EDETACHED) {
15065 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15069 LDKInitFeatures provided_init_features_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id) {
15070 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
15072 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15073 if (get_jenv_res == JNI_EDETACHED) {
15074 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15076 DO_ASSERT(get_jenv_res == JNI_OK);
15078 int8_tArray their_node_id_arr = (*env)->NewByteArray(env, 33);
15079 (*env)->SetByteArrayRegion(env, their_node_id_arr, 0, 33, their_node_id.compressed_form);
15080 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15081 CHECK(obj != NULL);
15082 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->provided_init_features_meth, their_node_id_arr);
15083 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15084 (*env)->ExceptionDescribe(env);
15085 (*env)->FatalError(env, "A call to provided_init_features in LDKOnionMessageHandler from rust threw an exception.");
15087 LDKInitFeatures ret_conv;
15088 ret_conv.inner = untag_ptr(ret);
15089 ret_conv.is_owned = ptr_is_owned(ret);
15090 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
15091 if (get_jenv_res == JNI_EDETACHED) {
15092 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15096 static void LDKOnionMessageHandler_JCalls_cloned(LDKOnionMessageHandler* new_obj) {
15097 LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) new_obj->this_arg;
15098 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
15099 atomic_fetch_add_explicit(&j_calls->OnionMessageProvider->refcnt, 1, memory_order_release);
15101 static inline LDKOnionMessageHandler LDKOnionMessageHandler_init (JNIEnv *env, jclass clz, jobject o, jobject OnionMessageProvider) {
15102 jclass c = (*env)->GetObjectClass(env, o);
15104 LDKOnionMessageHandler_JCalls *calls = MALLOC(sizeof(LDKOnionMessageHandler_JCalls), "LDKOnionMessageHandler_JCalls");
15105 atomic_init(&calls->refcnt, 1);
15106 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
15107 calls->o = (*env)->NewWeakGlobalRef(env, o);
15108 calls->handle_onion_message_meth = (*env)->GetMethodID(env, c, "handle_onion_message", "([BJ)V");
15109 CHECK(calls->handle_onion_message_meth != NULL);
15110 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJZ)J");
15111 CHECK(calls->peer_connected_meth != NULL);
15112 calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "([B)V");
15113 CHECK(calls->peer_disconnected_meth != NULL);
15114 calls->provided_node_features_meth = (*env)->GetMethodID(env, c, "provided_node_features", "()J");
15115 CHECK(calls->provided_node_features_meth != NULL);
15116 calls->provided_init_features_meth = (*env)->GetMethodID(env, c, "provided_init_features", "([B)J");
15117 CHECK(calls->provided_init_features_meth != NULL);
15119 LDKOnionMessageHandler ret = {
15120 .this_arg = (void*) calls,
15121 .handle_onion_message = handle_onion_message_LDKOnionMessageHandler_jcall,
15122 .peer_connected = peer_connected_LDKOnionMessageHandler_jcall,
15123 .peer_disconnected = peer_disconnected_LDKOnionMessageHandler_jcall,
15124 .provided_node_features = provided_node_features_LDKOnionMessageHandler_jcall,
15125 .provided_init_features = provided_init_features_LDKOnionMessageHandler_jcall,
15126 .free = LDKOnionMessageHandler_JCalls_free,
15127 .OnionMessageProvider = LDKOnionMessageProvider_init(env, clz, OnionMessageProvider),
15129 calls->OnionMessageProvider = ret.OnionMessageProvider.this_arg;
15132 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKOnionMessageHandler_1new(JNIEnv *env, jclass clz, jobject o, jobject OnionMessageProvider) {
15133 LDKOnionMessageHandler *res_ptr = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler");
15134 *res_ptr = LDKOnionMessageHandler_init(env, clz, o, OnionMessageProvider);
15135 return tag_ptr(res_ptr, true);
15137 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKOnionMessageHandler_1get_1OnionMessageProvider(JNIEnv *env, jclass clz, int64_t arg) {
15138 LDKOnionMessageHandler *inp = (LDKOnionMessageHandler *)untag_ptr(arg);
15139 return tag_ptr(&inp->OnionMessageProvider, false);
15141 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) {
15142 void* this_arg_ptr = untag_ptr(this_arg);
15143 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15144 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
15145 LDKPublicKey peer_node_id_ref;
15146 CHECK((*env)->GetArrayLength(env, peer_node_id) == 33);
15147 (*env)->GetByteArrayRegion(env, peer_node_id, 0, 33, peer_node_id_ref.compressed_form);
15148 LDKOnionMessage msg_conv;
15149 msg_conv.inner = untag_ptr(msg);
15150 msg_conv.is_owned = ptr_is_owned(msg);
15151 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
15152 msg_conv.is_owned = false;
15153 (this_arg_conv->handle_onion_message)(this_arg_conv->this_arg, peer_node_id_ref, &msg_conv);
15156 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) {
15157 void* this_arg_ptr = untag_ptr(this_arg);
15158 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15159 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
15160 LDKPublicKey their_node_id_ref;
15161 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
15162 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
15164 init_conv.inner = untag_ptr(init);
15165 init_conv.is_owned = ptr_is_owned(init);
15166 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
15167 init_conv.is_owned = false;
15168 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
15169 *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv, inbound);
15170 return tag_ptr(ret_conv, true);
15173 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1peer_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id) {
15174 void* this_arg_ptr = untag_ptr(this_arg);
15175 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15176 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
15177 LDKPublicKey their_node_id_ref;
15178 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
15179 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
15180 (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref);
15183 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1provided_1node_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
15184 void* this_arg_ptr = untag_ptr(this_arg);
15185 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15186 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
15187 LDKNodeFeatures ret_var = (this_arg_conv->provided_node_features)(this_arg_conv->this_arg);
15188 int64_t ret_ref = 0;
15189 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
15190 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
15194 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) {
15195 void* this_arg_ptr = untag_ptr(this_arg);
15196 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15197 LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
15198 LDKPublicKey their_node_id_ref;
15199 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
15200 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
15201 LDKInitFeatures ret_var = (this_arg_conv->provided_init_features)(this_arg_conv->this_arg, their_node_id_ref);
15202 int64_t ret_ref = 0;
15203 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
15204 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
15208 typedef struct LDKCustomMessageReader_JCalls {
15209 atomic_size_t refcnt;
15212 jmethodID read_meth;
15213 } LDKCustomMessageReader_JCalls;
15214 static void LDKCustomMessageReader_JCalls_free(void* this_arg) {
15215 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg;
15216 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
15218 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15219 if (get_jenv_res == JNI_EDETACHED) {
15220 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15222 DO_ASSERT(get_jenv_res == JNI_OK);
15224 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
15225 if (get_jenv_res == JNI_EDETACHED) {
15226 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15231 LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const void* this_arg, uint16_t message_type, LDKu8slice buffer) {
15232 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg;
15234 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15235 if (get_jenv_res == JNI_EDETACHED) {
15236 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15238 DO_ASSERT(get_jenv_res == JNI_OK);
15240 int16_t message_type_conv = message_type;
15241 LDKu8slice buffer_var = buffer;
15242 int8_tArray buffer_arr = (*env)->NewByteArray(env, buffer_var.datalen);
15243 (*env)->SetByteArrayRegion(env, buffer_arr, 0, buffer_var.datalen, buffer_var.data);
15244 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15245 CHECK(obj != NULL);
15246 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->read_meth, message_type_conv, buffer_arr);
15247 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15248 (*env)->ExceptionDescribe(env);
15249 (*env)->FatalError(env, "A call to read in LDKCustomMessageReader from rust threw an exception.");
15251 void* ret_ptr = untag_ptr(ret);
15252 CHECK_ACCESS(ret_ptr);
15253 LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr);
15254 FREE(untag_ptr(ret));
15255 if (get_jenv_res == JNI_EDETACHED) {
15256 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15260 static void LDKCustomMessageReader_JCalls_cloned(LDKCustomMessageReader* new_obj) {
15261 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) new_obj->this_arg;
15262 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
15264 static inline LDKCustomMessageReader LDKCustomMessageReader_init (JNIEnv *env, jclass clz, jobject o) {
15265 jclass c = (*env)->GetObjectClass(env, o);
15267 LDKCustomMessageReader_JCalls *calls = MALLOC(sizeof(LDKCustomMessageReader_JCalls), "LDKCustomMessageReader_JCalls");
15268 atomic_init(&calls->refcnt, 1);
15269 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
15270 calls->o = (*env)->NewWeakGlobalRef(env, o);
15271 calls->read_meth = (*env)->GetMethodID(env, c, "read", "(S[B)J");
15272 CHECK(calls->read_meth != NULL);
15274 LDKCustomMessageReader ret = {
15275 .this_arg = (void*) calls,
15276 .read = read_LDKCustomMessageReader_jcall,
15277 .free = LDKCustomMessageReader_JCalls_free,
15281 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomMessageReader_1new(JNIEnv *env, jclass clz, jobject o) {
15282 LDKCustomMessageReader *res_ptr = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
15283 *res_ptr = LDKCustomMessageReader_init(env, clz, o);
15284 return tag_ptr(res_ptr, true);
15286 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) {
15287 void* this_arg_ptr = untag_ptr(this_arg);
15288 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15289 LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)this_arg_ptr;
15290 LDKu8slice buffer_ref;
15291 buffer_ref.datalen = (*env)->GetArrayLength(env, buffer);
15292 buffer_ref.data = (*env)->GetByteArrayElements (env, buffer, NULL);
15293 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
15294 *ret_conv = (this_arg_conv->read)(this_arg_conv->this_arg, message_type, buffer_ref);
15295 (*env)->ReleaseByteArrayElements(env, buffer, (int8_t*)buffer_ref.data, 0);
15296 return tag_ptr(ret_conv, true);
15299 typedef struct LDKCustomMessageHandler_JCalls {
15300 atomic_size_t refcnt;
15303 LDKCustomMessageReader_JCalls* CustomMessageReader;
15304 jmethodID handle_custom_message_meth;
15305 jmethodID get_and_clear_pending_msg_meth;
15306 } LDKCustomMessageHandler_JCalls;
15307 static void LDKCustomMessageHandler_JCalls_free(void* this_arg) {
15308 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
15309 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
15311 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15312 if (get_jenv_res == JNI_EDETACHED) {
15313 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15315 DO_ASSERT(get_jenv_res == JNI_OK);
15317 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
15318 if (get_jenv_res == JNI_EDETACHED) {
15319 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15324 LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jcall(const void* this_arg, LDKType msg, LDKPublicKey sender_node_id) {
15325 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
15327 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15328 if (get_jenv_res == JNI_EDETACHED) {
15329 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15331 DO_ASSERT(get_jenv_res == JNI_OK);
15333 LDKType* msg_ret = MALLOC(sizeof(LDKType), "LDKType");
15335 int8_tArray sender_node_id_arr = (*env)->NewByteArray(env, 33);
15336 (*env)->SetByteArrayRegion(env, sender_node_id_arr, 0, 33, sender_node_id.compressed_form);
15337 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15338 CHECK(obj != NULL);
15339 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->handle_custom_message_meth, tag_ptr(msg_ret, true), sender_node_id_arr);
15340 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15341 (*env)->ExceptionDescribe(env);
15342 (*env)->FatalError(env, "A call to handle_custom_message in LDKCustomMessageHandler from rust threw an exception.");
15344 void* ret_ptr = untag_ptr(ret);
15345 CHECK_ACCESS(ret_ptr);
15346 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
15347 FREE(untag_ptr(ret));
15348 if (get_jenv_res == JNI_EDETACHED) {
15349 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15353 LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandler_jcall(const void* this_arg) {
15354 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
15356 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15357 if (get_jenv_res == JNI_EDETACHED) {
15358 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15360 DO_ASSERT(get_jenv_res == JNI_OK);
15362 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15363 CHECK(obj != NULL);
15364 int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_pending_msg_meth);
15365 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15366 (*env)->ExceptionDescribe(env);
15367 (*env)->FatalError(env, "A call to get_and_clear_pending_msg in LDKCustomMessageHandler from rust threw an exception.");
15369 LDKCVec_C2Tuple_PublicKeyTypeZZ ret_constr;
15370 ret_constr.datalen = (*env)->GetArrayLength(env, ret);
15371 if (ret_constr.datalen > 0)
15372 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
15374 ret_constr.data = NULL;
15375 int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL);
15376 for (size_t z = 0; z < ret_constr.datalen; z++) {
15377 int64_t ret_conv_25 = ret_vals[z];
15378 void* ret_conv_25_ptr = untag_ptr(ret_conv_25);
15379 CHECK_ACCESS(ret_conv_25_ptr);
15380 LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr);
15381 FREE(untag_ptr(ret_conv_25));
15382 ret_constr.data[z] = ret_conv_25_conv;
15384 (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0);
15385 if (get_jenv_res == JNI_EDETACHED) {
15386 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15390 static void LDKCustomMessageHandler_JCalls_cloned(LDKCustomMessageHandler* new_obj) {
15391 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) new_obj->this_arg;
15392 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
15393 atomic_fetch_add_explicit(&j_calls->CustomMessageReader->refcnt, 1, memory_order_release);
15395 static inline LDKCustomMessageHandler LDKCustomMessageHandler_init (JNIEnv *env, jclass clz, jobject o, jobject CustomMessageReader) {
15396 jclass c = (*env)->GetObjectClass(env, o);
15398 LDKCustomMessageHandler_JCalls *calls = MALLOC(sizeof(LDKCustomMessageHandler_JCalls), "LDKCustomMessageHandler_JCalls");
15399 atomic_init(&calls->refcnt, 1);
15400 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
15401 calls->o = (*env)->NewWeakGlobalRef(env, o);
15402 calls->handle_custom_message_meth = (*env)->GetMethodID(env, c, "handle_custom_message", "(J[B)J");
15403 CHECK(calls->handle_custom_message_meth != NULL);
15404 calls->get_and_clear_pending_msg_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg", "()[J");
15405 CHECK(calls->get_and_clear_pending_msg_meth != NULL);
15407 LDKCustomMessageHandler ret = {
15408 .this_arg = (void*) calls,
15409 .handle_custom_message = handle_custom_message_LDKCustomMessageHandler_jcall,
15410 .get_and_clear_pending_msg = get_and_clear_pending_msg_LDKCustomMessageHandler_jcall,
15411 .free = LDKCustomMessageHandler_JCalls_free,
15412 .CustomMessageReader = LDKCustomMessageReader_init(env, clz, CustomMessageReader),
15414 calls->CustomMessageReader = ret.CustomMessageReader.this_arg;
15417 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomMessageHandler_1new(JNIEnv *env, jclass clz, jobject o, jobject CustomMessageReader) {
15418 LDKCustomMessageHandler *res_ptr = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
15419 *res_ptr = LDKCustomMessageHandler_init(env, clz, o, CustomMessageReader);
15420 return tag_ptr(res_ptr, true);
15422 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomMessageHandler_1get_1CustomMessageReader(JNIEnv *env, jclass clz, int64_t arg) {
15423 LDKCustomMessageHandler *inp = (LDKCustomMessageHandler *)untag_ptr(arg);
15424 return tag_ptr(&inp->CustomMessageReader, false);
15426 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) {
15427 void* this_arg_ptr = untag_ptr(this_arg);
15428 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15429 LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
15430 void* msg_ptr = untag_ptr(msg);
15431 CHECK_ACCESS(msg_ptr);
15432 LDKType msg_conv = *(LDKType*)(msg_ptr);
15433 if (msg_conv.free == LDKType_JCalls_free) {
15434 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
15435 LDKType_JCalls_cloned(&msg_conv);
15437 LDKPublicKey sender_node_id_ref;
15438 CHECK((*env)->GetArrayLength(env, sender_node_id) == 33);
15439 (*env)->GetByteArrayRegion(env, sender_node_id, 0, 33, sender_node_id_ref.compressed_form);
15440 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
15441 *ret_conv = (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv, sender_node_id_ref);
15442 return tag_ptr(ret_conv, true);
15445 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1get_1and_1clear_1pending_1msg(JNIEnv *env, jclass clz, int64_t this_arg) {
15446 void* this_arg_ptr = untag_ptr(this_arg);
15447 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15448 LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
15449 LDKCVec_C2Tuple_PublicKeyTypeZZ ret_var = (this_arg_conv->get_and_clear_pending_msg)(this_arg_conv->this_arg);
15450 int64_tArray ret_arr = NULL;
15451 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
15452 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
15453 for (size_t z = 0; z < ret_var.datalen; z++) {
15454 LDKC2Tuple_PublicKeyTypeZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
15455 *ret_conv_25_conv = ret_var.data[z];
15456 ret_arr_ptr[z] = tag_ptr(ret_conv_25_conv, true);
15458 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
15459 FREE(ret_var.data);
15463 typedef struct LDKCustomOnionMessageHandler_JCalls {
15464 atomic_size_t refcnt;
15467 jmethodID handle_custom_message_meth;
15468 jmethodID read_custom_message_meth;
15469 } LDKCustomOnionMessageHandler_JCalls;
15470 static void LDKCustomOnionMessageHandler_JCalls_free(void* this_arg) {
15471 LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
15472 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
15474 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15475 if (get_jenv_res == JNI_EDETACHED) {
15476 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15478 DO_ASSERT(get_jenv_res == JNI_OK);
15480 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
15481 if (get_jenv_res == JNI_EDETACHED) {
15482 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15487 void handle_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, LDKCustomOnionMessageContents msg) {
15488 LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
15490 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15491 if (get_jenv_res == JNI_EDETACHED) {
15492 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15494 DO_ASSERT(get_jenv_res == JNI_OK);
15496 LDKCustomOnionMessageContents* msg_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
15498 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15499 CHECK(obj != NULL);
15500 (*env)->CallVoidMethod(env, obj, j_calls->handle_custom_message_meth, tag_ptr(msg_ret, true));
15501 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15502 (*env)->ExceptionDescribe(env);
15503 (*env)->FatalError(env, "A call to handle_custom_message in LDKCustomOnionMessageHandler from rust threw an exception.");
15505 if (get_jenv_res == JNI_EDETACHED) {
15506 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15509 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ read_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, uint64_t message_type, LDKu8slice buffer) {
15510 LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
15512 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15513 if (get_jenv_res == JNI_EDETACHED) {
15514 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15516 DO_ASSERT(get_jenv_res == JNI_OK);
15518 int64_t message_type_conv = message_type;
15519 LDKu8slice buffer_var = buffer;
15520 int8_tArray buffer_arr = (*env)->NewByteArray(env, buffer_var.datalen);
15521 (*env)->SetByteArrayRegion(env, buffer_arr, 0, buffer_var.datalen, buffer_var.data);
15522 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15523 CHECK(obj != NULL);
15524 uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->read_custom_message_meth, message_type_conv, buffer_arr);
15525 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15526 (*env)->ExceptionDescribe(env);
15527 (*env)->FatalError(env, "A call to read_custom_message in LDKCustomOnionMessageHandler from rust threw an exception.");
15529 void* ret_ptr = untag_ptr(ret);
15530 CHECK_ACCESS(ret_ptr);
15531 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ ret_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(ret_ptr);
15532 FREE(untag_ptr(ret));
15533 if (get_jenv_res == JNI_EDETACHED) {
15534 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15538 static void LDKCustomOnionMessageHandler_JCalls_cloned(LDKCustomOnionMessageHandler* new_obj) {
15539 LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) new_obj->this_arg;
15540 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
15542 static inline LDKCustomOnionMessageHandler LDKCustomOnionMessageHandler_init (JNIEnv *env, jclass clz, jobject o) {
15543 jclass c = (*env)->GetObjectClass(env, o);
15545 LDKCustomOnionMessageHandler_JCalls *calls = MALLOC(sizeof(LDKCustomOnionMessageHandler_JCalls), "LDKCustomOnionMessageHandler_JCalls");
15546 atomic_init(&calls->refcnt, 1);
15547 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
15548 calls->o = (*env)->NewWeakGlobalRef(env, o);
15549 calls->handle_custom_message_meth = (*env)->GetMethodID(env, c, "handle_custom_message", "(J)V");
15550 CHECK(calls->handle_custom_message_meth != NULL);
15551 calls->read_custom_message_meth = (*env)->GetMethodID(env, c, "read_custom_message", "(J[B)J");
15552 CHECK(calls->read_custom_message_meth != NULL);
15554 LDKCustomOnionMessageHandler ret = {
15555 .this_arg = (void*) calls,
15556 .handle_custom_message = handle_custom_message_LDKCustomOnionMessageHandler_jcall,
15557 .read_custom_message = read_custom_message_LDKCustomOnionMessageHandler_jcall,
15558 .free = LDKCustomOnionMessageHandler_JCalls_free,
15562 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomOnionMessageHandler_1new(JNIEnv *env, jclass clz, jobject o) {
15563 LDKCustomOnionMessageHandler *res_ptr = MALLOC(sizeof(LDKCustomOnionMessageHandler), "LDKCustomOnionMessageHandler");
15564 *res_ptr = LDKCustomOnionMessageHandler_init(env, clz, o);
15565 return tag_ptr(res_ptr, true);
15567 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1handle_1custom_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
15568 void* this_arg_ptr = untag_ptr(this_arg);
15569 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15570 LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr;
15571 void* msg_ptr = untag_ptr(msg);
15572 CHECK_ACCESS(msg_ptr);
15573 LDKCustomOnionMessageContents msg_conv = *(LDKCustomOnionMessageContents*)(msg_ptr);
15574 if (msg_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
15575 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
15576 LDKCustomOnionMessageContents_JCalls_cloned(&msg_conv);
15578 (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv);
15581 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) {
15582 void* this_arg_ptr = untag_ptr(this_arg);
15583 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15584 LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr;
15585 LDKu8slice buffer_ref;
15586 buffer_ref.datalen = (*env)->GetArrayLength(env, buffer);
15587 buffer_ref.data = (*env)->GetByteArrayElements (env, buffer, NULL);
15588 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
15589 *ret_conv = (this_arg_conv->read_custom_message)(this_arg_conv->this_arg, message_type, buffer_ref);
15590 (*env)->ReleaseByteArrayElements(env, buffer, (int8_t*)buffer_ref.data, 0);
15591 return tag_ptr(ret_conv, true);
15594 typedef struct LDKSocketDescriptor_JCalls {
15595 atomic_size_t refcnt;
15598 jmethodID send_data_meth;
15599 jmethodID disconnect_socket_meth;
15601 jmethodID hash_meth;
15602 } LDKSocketDescriptor_JCalls;
15603 static void LDKSocketDescriptor_JCalls_free(void* this_arg) {
15604 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
15605 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
15607 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15608 if (get_jenv_res == JNI_EDETACHED) {
15609 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15611 DO_ASSERT(get_jenv_res == JNI_OK);
15613 (*env)->DeleteWeakGlobalRef(env, j_calls->o);
15614 if (get_jenv_res == JNI_EDETACHED) {
15615 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15620 uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
15621 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
15623 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15624 if (get_jenv_res == JNI_EDETACHED) {
15625 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15627 DO_ASSERT(get_jenv_res == JNI_OK);
15629 LDKu8slice data_var = data;
15630 int8_tArray data_arr = (*env)->NewByteArray(env, data_var.datalen);
15631 (*env)->SetByteArrayRegion(env, data_arr, 0, data_var.datalen, data_var.data);
15632 jboolean resume_read_conv = resume_read;
15633 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15634 CHECK(obj != NULL);
15635 int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_data_meth, data_arr, resume_read_conv);
15636 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15637 (*env)->ExceptionDescribe(env);
15638 (*env)->FatalError(env, "A call to send_data in LDKSocketDescriptor from rust threw an exception.");
15640 if (get_jenv_res == JNI_EDETACHED) {
15641 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15645 void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) {
15646 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
15648 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15649 if (get_jenv_res == JNI_EDETACHED) {
15650 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15652 DO_ASSERT(get_jenv_res == JNI_OK);
15654 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15655 CHECK(obj != NULL);
15656 (*env)->CallVoidMethod(env, obj, j_calls->disconnect_socket_meth);
15657 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15658 (*env)->ExceptionDescribe(env);
15659 (*env)->FatalError(env, "A call to disconnect_socket in LDKSocketDescriptor from rust threw an exception.");
15661 if (get_jenv_res == JNI_EDETACHED) {
15662 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15665 bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) {
15666 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
15668 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15669 if (get_jenv_res == JNI_EDETACHED) {
15670 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15672 DO_ASSERT(get_jenv_res == JNI_OK);
15674 LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
15675 *other_arg_clone = SocketDescriptor_clone(other_arg);
15676 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15677 CHECK(obj != NULL);
15678 jboolean ret = (*env)->CallBooleanMethod(env, obj, j_calls->eq_meth, tag_ptr(other_arg_clone, true));
15679 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15680 (*env)->ExceptionDescribe(env);
15681 (*env)->FatalError(env, "A call to eq in LDKSocketDescriptor from rust threw an exception.");
15683 if (get_jenv_res == JNI_EDETACHED) {
15684 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15688 uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) {
15689 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
15691 jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
15692 if (get_jenv_res == JNI_EDETACHED) {
15693 DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
15695 DO_ASSERT(get_jenv_res == JNI_OK);
15697 jobject obj = (*env)->NewLocalRef(env, j_calls->o);
15698 CHECK(obj != NULL);
15699 int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->hash_meth);
15700 if (UNLIKELY((*env)->ExceptionCheck(env))) {
15701 (*env)->ExceptionDescribe(env);
15702 (*env)->FatalError(env, "A call to hash in LDKSocketDescriptor from rust threw an exception.");
15704 if (get_jenv_res == JNI_EDETACHED) {
15705 DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
15709 static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) {
15710 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg;
15711 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
15713 static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv *env, jclass clz, jobject o) {
15714 jclass c = (*env)->GetObjectClass(env, o);
15716 LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
15717 atomic_init(&calls->refcnt, 1);
15718 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
15719 calls->o = (*env)->NewWeakGlobalRef(env, o);
15720 calls->send_data_meth = (*env)->GetMethodID(env, c, "send_data", "([BZ)J");
15721 CHECK(calls->send_data_meth != NULL);
15722 calls->disconnect_socket_meth = (*env)->GetMethodID(env, c, "disconnect_socket", "()V");
15723 CHECK(calls->disconnect_socket_meth != NULL);
15724 calls->eq_meth = (*env)->GetMethodID(env, c, "eq", "(J)Z");
15725 CHECK(calls->eq_meth != NULL);
15726 calls->hash_meth = (*env)->GetMethodID(env, c, "hash", "()J");
15727 CHECK(calls->hash_meth != NULL);
15729 LDKSocketDescriptor ret = {
15730 .this_arg = (void*) calls,
15731 .send_data = send_data_LDKSocketDescriptor_jcall,
15732 .disconnect_socket = disconnect_socket_LDKSocketDescriptor_jcall,
15733 .eq = eq_LDKSocketDescriptor_jcall,
15734 .hash = hash_LDKSocketDescriptor_jcall,
15735 .cloned = LDKSocketDescriptor_JCalls_cloned,
15736 .free = LDKSocketDescriptor_JCalls_free,
15740 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new(JNIEnv *env, jclass clz, jobject o) {
15741 LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
15742 *res_ptr = LDKSocketDescriptor_init(env, clz, o);
15743 return tag_ptr(res_ptr, true);
15745 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) {
15746 void* this_arg_ptr = untag_ptr(this_arg);
15747 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15748 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
15749 LDKu8slice data_ref;
15750 data_ref.datalen = (*env)->GetArrayLength(env, data);
15751 data_ref.data = (*env)->GetByteArrayElements (env, data, NULL);
15752 int64_t ret_conv = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read);
15753 (*env)->ReleaseByteArrayElements(env, data, (int8_t*)data_ref.data, 0);
15757 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1disconnect_1socket(JNIEnv *env, jclass clz, int64_t this_arg) {
15758 void* this_arg_ptr = untag_ptr(this_arg);
15759 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15760 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
15761 (this_arg_conv->disconnect_socket)(this_arg_conv->this_arg);
15764 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
15765 void* this_arg_ptr = untag_ptr(this_arg);
15766 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
15767 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
15768 int64_t ret_conv = (this_arg_conv->hash)(this_arg_conv->this_arg);
15772 static jclass LDKEffectiveCapacity_ExactLiquidity_class = NULL;
15773 static jmethodID LDKEffectiveCapacity_ExactLiquidity_meth = NULL;
15774 static jclass LDKEffectiveCapacity_MaximumHTLC_class = NULL;
15775 static jmethodID LDKEffectiveCapacity_MaximumHTLC_meth = NULL;
15776 static jclass LDKEffectiveCapacity_Total_class = NULL;
15777 static jmethodID LDKEffectiveCapacity_Total_meth = NULL;
15778 static jclass LDKEffectiveCapacity_Infinite_class = NULL;
15779 static jmethodID LDKEffectiveCapacity_Infinite_meth = NULL;
15780 static jclass LDKEffectiveCapacity_Unknown_class = NULL;
15781 static jmethodID LDKEffectiveCapacity_Unknown_meth = NULL;
15782 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEffectiveCapacity_init (JNIEnv *env, jclass clz) {
15783 LDKEffectiveCapacity_ExactLiquidity_class =
15784 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$ExactLiquidity"));
15785 CHECK(LDKEffectiveCapacity_ExactLiquidity_class != NULL);
15786 LDKEffectiveCapacity_ExactLiquidity_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_ExactLiquidity_class, "<init>", "(J)V");
15787 CHECK(LDKEffectiveCapacity_ExactLiquidity_meth != NULL);
15788 LDKEffectiveCapacity_MaximumHTLC_class =
15789 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$MaximumHTLC"));
15790 CHECK(LDKEffectiveCapacity_MaximumHTLC_class != NULL);
15791 LDKEffectiveCapacity_MaximumHTLC_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_MaximumHTLC_class, "<init>", "(J)V");
15792 CHECK(LDKEffectiveCapacity_MaximumHTLC_meth != NULL);
15793 LDKEffectiveCapacity_Total_class =
15794 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$Total"));
15795 CHECK(LDKEffectiveCapacity_Total_class != NULL);
15796 LDKEffectiveCapacity_Total_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_Total_class, "<init>", "(JJ)V");
15797 CHECK(LDKEffectiveCapacity_Total_meth != NULL);
15798 LDKEffectiveCapacity_Infinite_class =
15799 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$Infinite"));
15800 CHECK(LDKEffectiveCapacity_Infinite_class != NULL);
15801 LDKEffectiveCapacity_Infinite_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_Infinite_class, "<init>", "()V");
15802 CHECK(LDKEffectiveCapacity_Infinite_meth != NULL);
15803 LDKEffectiveCapacity_Unknown_class =
15804 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEffectiveCapacity$Unknown"));
15805 CHECK(LDKEffectiveCapacity_Unknown_class != NULL);
15806 LDKEffectiveCapacity_Unknown_meth = (*env)->GetMethodID(env, LDKEffectiveCapacity_Unknown_class, "<init>", "()V");
15807 CHECK(LDKEffectiveCapacity_Unknown_meth != NULL);
15809 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEffectiveCapacity_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
15810 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
15812 case LDKEffectiveCapacity_ExactLiquidity: {
15813 int64_t liquidity_msat_conv = obj->exact_liquidity.liquidity_msat;
15814 return (*env)->NewObject(env, LDKEffectiveCapacity_ExactLiquidity_class, LDKEffectiveCapacity_ExactLiquidity_meth, liquidity_msat_conv);
15816 case LDKEffectiveCapacity_MaximumHTLC: {
15817 int64_t amount_msat_conv = obj->maximum_htlc.amount_msat;
15818 return (*env)->NewObject(env, LDKEffectiveCapacity_MaximumHTLC_class, LDKEffectiveCapacity_MaximumHTLC_meth, amount_msat_conv);
15820 case LDKEffectiveCapacity_Total: {
15821 int64_t capacity_msat_conv = obj->total.capacity_msat;
15822 int64_t htlc_maximum_msat_conv = obj->total.htlc_maximum_msat;
15823 return (*env)->NewObject(env, LDKEffectiveCapacity_Total_class, LDKEffectiveCapacity_Total_meth, capacity_msat_conv, htlc_maximum_msat_conv);
15825 case LDKEffectiveCapacity_Infinite: {
15826 return (*env)->NewObject(env, LDKEffectiveCapacity_Infinite_class, LDKEffectiveCapacity_Infinite_meth);
15828 case LDKEffectiveCapacity_Unknown: {
15829 return (*env)->NewObject(env, LDKEffectiveCapacity_Unknown_class, LDKEffectiveCapacity_Unknown_meth);
15834 static jclass LDKHints_Blinded_class = NULL;
15835 static jmethodID LDKHints_Blinded_meth = NULL;
15836 static jclass LDKHints_Clear_class = NULL;
15837 static jmethodID LDKHints_Clear_meth = NULL;
15838 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHints_init (JNIEnv *env, jclass clz) {
15839 LDKHints_Blinded_class =
15840 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHints$Blinded"));
15841 CHECK(LDKHints_Blinded_class != NULL);
15842 LDKHints_Blinded_meth = (*env)->GetMethodID(env, LDKHints_Blinded_class, "<init>", "([J)V");
15843 CHECK(LDKHints_Blinded_meth != NULL);
15844 LDKHints_Clear_class =
15845 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHints$Clear"));
15846 CHECK(LDKHints_Clear_class != NULL);
15847 LDKHints_Clear_meth = (*env)->GetMethodID(env, LDKHints_Clear_class, "<init>", "([J)V");
15848 CHECK(LDKHints_Clear_meth != NULL);
15850 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKHints_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
15851 LDKHints *obj = (LDKHints*)untag_ptr(ptr);
15853 case LDKHints_Blinded: {
15854 LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_var = obj->blinded;
15855 int64_tArray blinded_arr = NULL;
15856 blinded_arr = (*env)->NewLongArray(env, blinded_var.datalen);
15857 int64_t *blinded_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, blinded_arr, NULL);
15858 for (size_t l = 0; l < blinded_var.datalen; l++) {
15859 LDKC2Tuple_BlindedPayInfoBlindedPathZ* blinded_conv_37_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ");
15860 *blinded_conv_37_conv = blinded_var.data[l];
15861 *blinded_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(blinded_conv_37_conv);
15862 blinded_arr_ptr[l] = tag_ptr(blinded_conv_37_conv, true);
15864 (*env)->ReleasePrimitiveArrayCritical(env, blinded_arr, blinded_arr_ptr, 0);
15865 return (*env)->NewObject(env, LDKHints_Blinded_class, LDKHints_Blinded_meth, blinded_arr);
15867 case LDKHints_Clear: {
15868 LDKCVec_RouteHintZ clear_var = obj->clear;
15869 int64_tArray clear_arr = NULL;
15870 clear_arr = (*env)->NewLongArray(env, clear_var.datalen);
15871 int64_t *clear_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, clear_arr, NULL);
15872 for (size_t l = 0; l < clear_var.datalen; l++) {
15873 LDKRouteHint clear_conv_11_var = clear_var.data[l];
15874 int64_t clear_conv_11_ref = 0;
15875 CHECK_INNER_FIELD_ACCESS_OR_NULL(clear_conv_11_var);
15876 clear_conv_11_ref = tag_ptr(clear_conv_11_var.inner, false);
15877 clear_arr_ptr[l] = clear_conv_11_ref;
15879 (*env)->ReleasePrimitiveArrayCritical(env, clear_arr, clear_arr_ptr, 0);
15880 return (*env)->NewObject(env, LDKHints_Clear_class, LDKHints_Clear_meth, clear_arr);
15885 static jclass LDKDestination_Node_class = NULL;
15886 static jmethodID LDKDestination_Node_meth = NULL;
15887 static jclass LDKDestination_BlindedPath_class = NULL;
15888 static jmethodID LDKDestination_BlindedPath_meth = NULL;
15889 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDestination_init (JNIEnv *env, jclass clz) {
15890 LDKDestination_Node_class =
15891 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$Node"));
15892 CHECK(LDKDestination_Node_class != NULL);
15893 LDKDestination_Node_meth = (*env)->GetMethodID(env, LDKDestination_Node_class, "<init>", "([B)V");
15894 CHECK(LDKDestination_Node_meth != NULL);
15895 LDKDestination_BlindedPath_class =
15896 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$BlindedPath"));
15897 CHECK(LDKDestination_BlindedPath_class != NULL);
15898 LDKDestination_BlindedPath_meth = (*env)->GetMethodID(env, LDKDestination_BlindedPath_class, "<init>", "(J)V");
15899 CHECK(LDKDestination_BlindedPath_meth != NULL);
15901 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDestination_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
15902 LDKDestination *obj = (LDKDestination*)untag_ptr(ptr);
15904 case LDKDestination_Node: {
15905 int8_tArray node_arr = (*env)->NewByteArray(env, 33);
15906 (*env)->SetByteArrayRegion(env, node_arr, 0, 33, obj->node.compressed_form);
15907 return (*env)->NewObject(env, LDKDestination_Node_class, LDKDestination_Node_meth, node_arr);
15909 case LDKDestination_BlindedPath: {
15910 LDKBlindedPath blinded_path_var = obj->blinded_path;
15911 int64_t blinded_path_ref = 0;
15912 CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_path_var);
15913 blinded_path_ref = tag_ptr(blinded_path_var.inner, false);
15914 return (*env)->NewObject(env, LDKDestination_BlindedPath_class, LDKDestination_BlindedPath_meth, blinded_path_ref);
15919 static jclass LDKOnionMessageContents_Custom_class = NULL;
15920 static jmethodID LDKOnionMessageContents_Custom_meth = NULL;
15921 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKOnionMessageContents_init (JNIEnv *env, jclass clz) {
15922 LDKOnionMessageContents_Custom_class =
15923 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKOnionMessageContents$Custom"));
15924 CHECK(LDKOnionMessageContents_Custom_class != NULL);
15925 LDKOnionMessageContents_Custom_meth = (*env)->GetMethodID(env, LDKOnionMessageContents_Custom_class, "<init>", "(J)V");
15926 CHECK(LDKOnionMessageContents_Custom_meth != NULL);
15928 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKOnionMessageContents_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
15929 LDKOnionMessageContents *obj = (LDKOnionMessageContents*)untag_ptr(ptr);
15931 case LDKOnionMessageContents_Custom: {
15932 LDKCustomOnionMessageContents* custom_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
15933 *custom_ret = CustomOnionMessageContents_clone(&obj->custom);
15934 return (*env)->NewObject(env, LDKOnionMessageContents_Custom_class, LDKOnionMessageContents_Custom_meth, tag_ptr(custom_ret, true));
15939 static jclass LDKGossipSync_P2P_class = NULL;
15940 static jmethodID LDKGossipSync_P2P_meth = NULL;
15941 static jclass LDKGossipSync_Rapid_class = NULL;
15942 static jmethodID LDKGossipSync_Rapid_meth = NULL;
15943 static jclass LDKGossipSync_None_class = NULL;
15944 static jmethodID LDKGossipSync_None_meth = NULL;
15945 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKGossipSync_init (JNIEnv *env, jclass clz) {
15946 LDKGossipSync_P2P_class =
15947 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGossipSync$P2P"));
15948 CHECK(LDKGossipSync_P2P_class != NULL);
15949 LDKGossipSync_P2P_meth = (*env)->GetMethodID(env, LDKGossipSync_P2P_class, "<init>", "(J)V");
15950 CHECK(LDKGossipSync_P2P_meth != NULL);
15951 LDKGossipSync_Rapid_class =
15952 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGossipSync$Rapid"));
15953 CHECK(LDKGossipSync_Rapid_class != NULL);
15954 LDKGossipSync_Rapid_meth = (*env)->GetMethodID(env, LDKGossipSync_Rapid_class, "<init>", "(J)V");
15955 CHECK(LDKGossipSync_Rapid_meth != NULL);
15956 LDKGossipSync_None_class =
15957 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKGossipSync$None"));
15958 CHECK(LDKGossipSync_None_class != NULL);
15959 LDKGossipSync_None_meth = (*env)->GetMethodID(env, LDKGossipSync_None_class, "<init>", "()V");
15960 CHECK(LDKGossipSync_None_meth != NULL);
15962 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKGossipSync_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
15963 LDKGossipSync *obj = (LDKGossipSync*)untag_ptr(ptr);
15965 case LDKGossipSync_P2P: {
15966 LDKP2PGossipSync p2p_var = obj->p2p;
15967 int64_t p2p_ref = 0;
15968 CHECK_INNER_FIELD_ACCESS_OR_NULL(p2p_var);
15969 p2p_ref = tag_ptr(p2p_var.inner, false);
15970 return (*env)->NewObject(env, LDKGossipSync_P2P_class, LDKGossipSync_P2P_meth, p2p_ref);
15972 case LDKGossipSync_Rapid: {
15973 LDKRapidGossipSync rapid_var = obj->rapid;
15974 int64_t rapid_ref = 0;
15975 CHECK_INNER_FIELD_ACCESS_OR_NULL(rapid_var);
15976 rapid_ref = tag_ptr(rapid_var.inner, false);
15977 return (*env)->NewObject(env, LDKGossipSync_Rapid_class, LDKGossipSync_Rapid_meth, rapid_ref);
15979 case LDKGossipSync_None: {
15980 return (*env)->NewObject(env, LDKGossipSync_None_class, LDKGossipSync_None_meth);
15985 static jclass LDKFallback_SegWitProgram_class = NULL;
15986 static jmethodID LDKFallback_SegWitProgram_meth = NULL;
15987 static jclass LDKFallback_PubKeyHash_class = NULL;
15988 static jmethodID LDKFallback_PubKeyHash_meth = NULL;
15989 static jclass LDKFallback_ScriptHash_class = NULL;
15990 static jmethodID LDKFallback_ScriptHash_meth = NULL;
15991 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKFallback_init (JNIEnv *env, jclass clz) {
15992 LDKFallback_SegWitProgram_class =
15993 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$SegWitProgram"));
15994 CHECK(LDKFallback_SegWitProgram_class != NULL);
15995 LDKFallback_SegWitProgram_meth = (*env)->GetMethodID(env, LDKFallback_SegWitProgram_class, "<init>", "(B[B)V");
15996 CHECK(LDKFallback_SegWitProgram_meth != NULL);
15997 LDKFallback_PubKeyHash_class =
15998 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$PubKeyHash"));
15999 CHECK(LDKFallback_PubKeyHash_class != NULL);
16000 LDKFallback_PubKeyHash_meth = (*env)->GetMethodID(env, LDKFallback_PubKeyHash_class, "<init>", "([B)V");
16001 CHECK(LDKFallback_PubKeyHash_meth != NULL);
16002 LDKFallback_ScriptHash_class =
16003 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$ScriptHash"));
16004 CHECK(LDKFallback_ScriptHash_class != NULL);
16005 LDKFallback_ScriptHash_meth = (*env)->GetMethodID(env, LDKFallback_ScriptHash_class, "<init>", "([B)V");
16006 CHECK(LDKFallback_ScriptHash_meth != NULL);
16008 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFallback_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
16009 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
16011 case LDKFallback_SegWitProgram: {
16012 uint8_t version_val = obj->seg_wit_program.version._0;
16013 LDKCVec_u8Z program_var = obj->seg_wit_program.program;
16014 int8_tArray program_arr = (*env)->NewByteArray(env, program_var.datalen);
16015 (*env)->SetByteArrayRegion(env, program_arr, 0, program_var.datalen, program_var.data);
16016 return (*env)->NewObject(env, LDKFallback_SegWitProgram_class, LDKFallback_SegWitProgram_meth, version_val, program_arr);
16018 case LDKFallback_PubKeyHash: {
16019 int8_tArray pub_key_hash_arr = (*env)->NewByteArray(env, 20);
16020 (*env)->SetByteArrayRegion(env, pub_key_hash_arr, 0, 20, obj->pub_key_hash.data);
16021 return (*env)->NewObject(env, LDKFallback_PubKeyHash_class, LDKFallback_PubKeyHash_meth, pub_key_hash_arr);
16023 case LDKFallback_ScriptHash: {
16024 int8_tArray script_hash_arr = (*env)->NewByteArray(env, 20);
16025 (*env)->SetByteArrayRegion(env, script_hash_arr, 0, 20, obj->script_hash.data);
16026 return (*env)->NewObject(env, LDKFallback_ScriptHash_class, LDKFallback_ScriptHash_meth, script_hash_arr);
16031 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1get_1compiled_1version(JNIEnv *env, jclass clz) {
16032 LDKStr ret_str = _ldk_get_compiled_version();
16033 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
16038 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1c_1bindings_1get_1compiled_1version(JNIEnv *env, jclass clz) {
16039 LDKStr ret_str = _ldk_c_bindings_get_compiled_version();
16040 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
16045 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_U128_1le_1bytes(JNIEnv *env, jclass clz, int8_tArray val) {
16047 CHECK((*env)->GetArrayLength(env, val) == 16);
16048 (*env)->GetByteArrayRegion(env, val, 0, 16, val_ref.le_bytes);
16049 int8_tArray ret_arr = (*env)->NewByteArray(env, 16);
16050 (*env)->SetByteArrayRegion(env, ret_arr, 0, 16, U128_le_bytes(val_ref).data);
16054 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_U128_1new(JNIEnv *env, jclass clz, int8_tArray le_bytes) {
16055 LDKSixteenBytes le_bytes_ref;
16056 CHECK((*env)->GetArrayLength(env, le_bytes) == 16);
16057 (*env)->GetByteArrayRegion(env, le_bytes, 0, 16, le_bytes_ref.data);
16058 int8_tArray ret_arr = (*env)->NewByteArray(env, 16);
16059 (*env)->SetByteArrayRegion(env, ret_arr, 0, 16, U128_new(le_bytes_ref).le_bytes);
16063 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BigEndianScalar_1new(JNIEnv *env, jclass clz, int8_tArray big_endian_bytes) {
16064 LDKThirtyTwoBytes big_endian_bytes_ref;
16065 CHECK((*env)->GetArrayLength(env, big_endian_bytes) == 32);
16066 (*env)->GetByteArrayRegion(env, big_endian_bytes, 0, 32, big_endian_bytes_ref.data);
16067 LDKBigEndianScalar* ret_ref = MALLOC(sizeof(LDKBigEndianScalar), "LDKBigEndianScalar");
16068 *ret_ref = BigEndianScalar_new(big_endian_bytes_ref);
16069 return tag_ptr(ret_ref, true);
16072 static inline uint64_t Bech32Error_clone_ptr(LDKBech32Error *NONNULL_PTR arg) {
16073 LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error");
16074 *ret_copy = Bech32Error_clone(arg);
16075 int64_t ret_ref = tag_ptr(ret_copy, true);
16078 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bech32Error_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16079 LDKBech32Error* arg_conv = (LDKBech32Error*)untag_ptr(arg);
16080 int64_t ret_conv = Bech32Error_clone_ptr(arg_conv);
16084 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bech32Error_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16085 LDKBech32Error* orig_conv = (LDKBech32Error*)untag_ptr(orig);
16086 LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error");
16087 *ret_copy = Bech32Error_clone(orig_conv);
16088 int64_t ret_ref = tag_ptr(ret_copy, true);
16092 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bech32Error_1free(JNIEnv *env, jclass clz, int64_t o) {
16093 if (!ptr_is_owned(o)) return;
16094 void* o_ptr = untag_ptr(o);
16095 CHECK_ACCESS(o_ptr);
16096 LDKBech32Error o_conv = *(LDKBech32Error*)(o_ptr);
16097 FREE(untag_ptr(o));
16098 Bech32Error_free(o_conv);
16101 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv *env, jclass clz, int8_tArray _res) {
16102 LDKTransaction _res_ref;
16103 _res_ref.datalen = (*env)->GetArrayLength(env, _res);
16104 _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes");
16105 (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data);
16106 _res_ref.data_is_owned = true;
16107 Transaction_free(_res_ref);
16110 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Witness_1free(JNIEnv *env, jclass clz, int8_tArray _res) {
16111 LDKWitness _res_ref;
16112 _res_ref.datalen = (*env)->GetArrayLength(env, _res);
16113 _res_ref.data = MALLOC(_res_ref.datalen, "LDKWitness Bytes");
16114 (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data);
16115 _res_ref.data_is_owned = true;
16116 Witness_free(_res_ref);
16119 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1new(JNIEnv *env, jclass clz, int8_tArray script_pubkey, int64_t value) {
16120 LDKCVec_u8Z script_pubkey_ref;
16121 script_pubkey_ref.datalen = (*env)->GetArrayLength(env, script_pubkey);
16122 script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes");
16123 (*env)->GetByteArrayRegion(env, script_pubkey, 0, script_pubkey_ref.datalen, script_pubkey_ref.data);
16124 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
16125 *ret_ref = TxOut_new(script_pubkey_ref, value);
16126 return tag_ptr(ret_ref, true);
16129 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv *env, jclass clz, int64_t _res) {
16130 if (!ptr_is_owned(_res)) return;
16131 void* _res_ptr = untag_ptr(_res);
16132 CHECK_ACCESS(_res_ptr);
16133 LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr);
16134 FREE(untag_ptr(_res));
16135 TxOut_free(_res_conv);
16138 static inline uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) {
16139 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
16140 *ret_ref = TxOut_clone(arg);
16141 return tag_ptr(ret_ref, true);
16143 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16144 LDKTxOut* arg_conv = (LDKTxOut*)untag_ptr(arg);
16145 int64_t ret_conv = TxOut_clone_ptr(arg_conv);
16149 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16150 LDKTxOut* orig_conv = (LDKTxOut*)untag_ptr(orig);
16151 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
16152 *ret_ref = TxOut_clone(orig_conv);
16153 return tag_ptr(ret_ref, true);
16156 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Str_1free(JNIEnv *env, jclass clz, jstring _res) {
16157 LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false };
16161 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1DurationZ_1some(JNIEnv *env, jclass clz, int64_t o) {
16162 LDKCOption_DurationZ *ret_copy = MALLOC(sizeof(LDKCOption_DurationZ), "LDKCOption_DurationZ");
16163 *ret_copy = COption_DurationZ_some(o);
16164 int64_t ret_ref = tag_ptr(ret_copy, true);
16168 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1DurationZ_1none(JNIEnv *env, jclass clz) {
16169 LDKCOption_DurationZ *ret_copy = MALLOC(sizeof(LDKCOption_DurationZ), "LDKCOption_DurationZ");
16170 *ret_copy = COption_DurationZ_none();
16171 int64_t ret_ref = tag_ptr(ret_copy, true);
16175 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1DurationZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16176 if (!ptr_is_owned(_res)) return;
16177 void* _res_ptr = untag_ptr(_res);
16178 CHECK_ACCESS(_res_ptr);
16179 LDKCOption_DurationZ _res_conv = *(LDKCOption_DurationZ*)(_res_ptr);
16180 FREE(untag_ptr(_res));
16181 COption_DurationZ_free(_res_conv);
16184 static inline uint64_t COption_DurationZ_clone_ptr(LDKCOption_DurationZ *NONNULL_PTR arg) {
16185 LDKCOption_DurationZ *ret_copy = MALLOC(sizeof(LDKCOption_DurationZ), "LDKCOption_DurationZ");
16186 *ret_copy = COption_DurationZ_clone(arg);
16187 int64_t ret_ref = tag_ptr(ret_copy, true);
16190 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1DurationZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16191 LDKCOption_DurationZ* arg_conv = (LDKCOption_DurationZ*)untag_ptr(arg);
16192 int64_t ret_conv = COption_DurationZ_clone_ptr(arg_conv);
16196 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1DurationZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16197 LDKCOption_DurationZ* orig_conv = (LDKCOption_DurationZ*)untag_ptr(orig);
16198 LDKCOption_DurationZ *ret_copy = MALLOC(sizeof(LDKCOption_DurationZ), "LDKCOption_DurationZ");
16199 *ret_copy = COption_DurationZ_clone(orig_conv);
16200 int64_t ret_ref = tag_ptr(ret_copy, true);
16204 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BlindedPathZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
16205 LDKCVec_BlindedPathZ _res_constr;
16206 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
16207 if (_res_constr.datalen > 0)
16208 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBlindedPath), "LDKCVec_BlindedPathZ Elements");
16210 _res_constr.data = NULL;
16211 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
16212 for (size_t n = 0; n < _res_constr.datalen; n++) {
16213 int64_t _res_conv_13 = _res_vals[n];
16214 LDKBlindedPath _res_conv_13_conv;
16215 _res_conv_13_conv.inner = untag_ptr(_res_conv_13);
16216 _res_conv_13_conv.is_owned = ptr_is_owned(_res_conv_13);
16217 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_13_conv);
16218 _res_constr.data[n] = _res_conv_13_conv;
16220 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
16221 CVec_BlindedPathZ_free(_res_constr);
16224 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1some(JNIEnv *env, jclass clz, int64_t o) {
16225 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
16226 *ret_copy = COption_u64Z_some(o);
16227 int64_t ret_ref = tag_ptr(ret_copy, true);
16231 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1none(JNIEnv *env, jclass clz) {
16232 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
16233 *ret_copy = COption_u64Z_none();
16234 int64_t ret_ref = tag_ptr(ret_copy, true);
16238 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
16239 if (!ptr_is_owned(_res)) return;
16240 void* _res_ptr = untag_ptr(_res);
16241 CHECK_ACCESS(_res_ptr);
16242 LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr);
16243 FREE(untag_ptr(_res));
16244 COption_u64Z_free(_res_conv);
16247 static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) {
16248 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
16249 *ret_copy = COption_u64Z_clone(arg);
16250 int64_t ret_ref = tag_ptr(ret_copy, true);
16253 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16254 LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)untag_ptr(arg);
16255 int64_t ret_conv = COption_u64Z_clone_ptr(arg_conv);
16259 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16260 LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)untag_ptr(orig);
16261 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
16262 *ret_copy = COption_u64Z_clone(orig_conv);
16263 int64_t ret_ref = tag_ptr(ret_copy, true);
16267 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv *env, jclass clz) {
16268 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
16269 *ret_conv = CResult_NoneAPIErrorZ_ok();
16270 return tag_ptr(ret_conv, true);
16273 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16274 void* e_ptr = untag_ptr(e);
16275 CHECK_ACCESS(e_ptr);
16276 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
16277 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
16278 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
16279 *ret_conv = CResult_NoneAPIErrorZ_err(e_conv);
16280 return tag_ptr(ret_conv, true);
16283 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16284 LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(o);
16285 jboolean ret_conv = CResult_NoneAPIErrorZ_is_ok(o_conv);
16289 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16290 if (!ptr_is_owned(_res)) return;
16291 void* _res_ptr = untag_ptr(_res);
16292 CHECK_ACCESS(_res_ptr);
16293 LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr);
16294 FREE(untag_ptr(_res));
16295 CResult_NoneAPIErrorZ_free(_res_conv);
16298 static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) {
16299 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
16300 *ret_conv = CResult_NoneAPIErrorZ_clone(arg);
16301 return tag_ptr(ret_conv, true);
16303 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16304 LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(arg);
16305 int64_t ret_conv = CResult_NoneAPIErrorZ_clone_ptr(arg_conv);
16309 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16310 LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(orig);
16311 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
16312 *ret_conv = CResult_NoneAPIErrorZ_clone(orig_conv);
16313 return tag_ptr(ret_conv, true);
16316 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CResult_1NoneAPIErrorZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
16317 LDKCVec_CResult_NoneAPIErrorZZ _res_constr;
16318 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
16319 if (_res_constr.datalen > 0)
16320 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
16322 _res_constr.data = NULL;
16323 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
16324 for (size_t w = 0; w < _res_constr.datalen; w++) {
16325 int64_t _res_conv_22 = _res_vals[w];
16326 void* _res_conv_22_ptr = untag_ptr(_res_conv_22);
16327 CHECK_ACCESS(_res_conv_22_ptr);
16328 LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr);
16329 FREE(untag_ptr(_res_conv_22));
16330 _res_constr.data[w] = _res_conv_22_conv;
16332 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
16333 CVec_CResult_NoneAPIErrorZZ_free(_res_constr);
16336 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1APIErrorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
16337 LDKCVec_APIErrorZ _res_constr;
16338 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
16339 if (_res_constr.datalen > 0)
16340 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
16342 _res_constr.data = NULL;
16343 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
16344 for (size_t k = 0; k < _res_constr.datalen; k++) {
16345 int64_t _res_conv_10 = _res_vals[k];
16346 void* _res_conv_10_ptr = untag_ptr(_res_conv_10);
16347 CHECK_ACCESS(_res_conv_10_ptr);
16348 LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr);
16349 FREE(untag_ptr(_res_conv_10));
16350 _res_constr.data[k] = _res_conv_10_conv;
16352 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
16353 CVec_APIErrorZ_free(_res_constr);
16356 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv *env, jclass clz, int8_tArray _res) {
16357 LDKCVec_u8Z _res_ref;
16358 _res_ref.datalen = (*env)->GetArrayLength(env, _res);
16359 _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes");
16360 (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data);
16361 CVec_u8Z_free(_res_ref);
16364 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_1some(JNIEnv *env, jclass clz, int8_tArray o) {
16366 o_ref.datalen = (*env)->GetArrayLength(env, o);
16367 o_ref.data = MALLOC(o_ref.datalen, "LDKCVec_u8Z Bytes");
16368 (*env)->GetByteArrayRegion(env, o, 0, o_ref.datalen, o_ref.data);
16369 LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ");
16370 *ret_copy = COption_CVec_u8ZZ_some(o_ref);
16371 int64_t ret_ref = tag_ptr(ret_copy, true);
16375 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_1none(JNIEnv *env, jclass clz) {
16376 LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ");
16377 *ret_copy = COption_CVec_u8ZZ_none();
16378 int64_t ret_ref = tag_ptr(ret_copy, true);
16382 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16383 if (!ptr_is_owned(_res)) return;
16384 void* _res_ptr = untag_ptr(_res);
16385 CHECK_ACCESS(_res_ptr);
16386 LDKCOption_CVec_u8ZZ _res_conv = *(LDKCOption_CVec_u8ZZ*)(_res_ptr);
16387 FREE(untag_ptr(_res));
16388 COption_CVec_u8ZZ_free(_res_conv);
16391 static inline uint64_t COption_CVec_u8ZZ_clone_ptr(LDKCOption_CVec_u8ZZ *NONNULL_PTR arg) {
16392 LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ");
16393 *ret_copy = COption_CVec_u8ZZ_clone(arg);
16394 int64_t ret_ref = tag_ptr(ret_copy, true);
16397 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16398 LDKCOption_CVec_u8ZZ* arg_conv = (LDKCOption_CVec_u8ZZ*)untag_ptr(arg);
16399 int64_t ret_conv = COption_CVec_u8ZZ_clone_ptr(arg_conv);
16403 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1u8ZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16404 LDKCOption_CVec_u8ZZ* orig_conv = (LDKCOption_CVec_u8ZZ*)untag_ptr(orig);
16405 LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ");
16406 *ret_copy = COption_CVec_u8ZZ_clone(orig_conv);
16407 int64_t ret_ref = tag_ptr(ret_copy, true);
16411 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16412 LDKRecipientOnionFields o_conv;
16413 o_conv.inner = untag_ptr(o);
16414 o_conv.is_owned = ptr_is_owned(o);
16415 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16416 o_conv = RecipientOnionFields_clone(&o_conv);
16417 LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ");
16418 *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_ok(o_conv);
16419 return tag_ptr(ret_conv, true);
16422 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16423 void* e_ptr = untag_ptr(e);
16424 CHECK_ACCESS(e_ptr);
16425 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16426 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16427 LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ");
16428 *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_err(e_conv);
16429 return tag_ptr(ret_conv, true);
16432 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16433 LDKCResult_RecipientOnionFieldsDecodeErrorZ* o_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(o);
16434 jboolean ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(o_conv);
16438 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16439 if (!ptr_is_owned(_res)) return;
16440 void* _res_ptr = untag_ptr(_res);
16441 CHECK_ACCESS(_res_ptr);
16442 LDKCResult_RecipientOnionFieldsDecodeErrorZ _res_conv = *(LDKCResult_RecipientOnionFieldsDecodeErrorZ*)(_res_ptr);
16443 FREE(untag_ptr(_res));
16444 CResult_RecipientOnionFieldsDecodeErrorZ_free(_res_conv);
16447 static inline uint64_t CResult_RecipientOnionFieldsDecodeErrorZ_clone_ptr(LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR arg) {
16448 LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ");
16449 *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_clone(arg);
16450 return tag_ptr(ret_conv, true);
16452 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16453 LDKCResult_RecipientOnionFieldsDecodeErrorZ* arg_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(arg);
16454 int64_t ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_clone_ptr(arg_conv);
16458 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecipientOnionFieldsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16459 LDKCResult_RecipientOnionFieldsDecodeErrorZ* orig_conv = (LDKCResult_RecipientOnionFieldsDecodeErrorZ*)untag_ptr(orig);
16460 LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ");
16461 *ret_conv = CResult_RecipientOnionFieldsDecodeErrorZ_clone(orig_conv);
16462 return tag_ptr(ret_conv, true);
16465 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCClaimZ_1some(JNIEnv *env, jclass clz, jclass o) {
16466 LDKHTLCClaim o_conv = LDKHTLCClaim_from_java(env, o);
16467 LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ");
16468 *ret_copy = COption_HTLCClaimZ_some(o_conv);
16469 int64_t ret_ref = tag_ptr(ret_copy, true);
16473 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCClaimZ_1none(JNIEnv *env, jclass clz) {
16474 LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ");
16475 *ret_copy = COption_HTLCClaimZ_none();
16476 int64_t ret_ref = tag_ptr(ret_copy, true);
16480 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1HTLCClaimZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16481 if (!ptr_is_owned(_res)) return;
16482 void* _res_ptr = untag_ptr(_res);
16483 CHECK_ACCESS(_res_ptr);
16484 LDKCOption_HTLCClaimZ _res_conv = *(LDKCOption_HTLCClaimZ*)(_res_ptr);
16485 FREE(untag_ptr(_res));
16486 COption_HTLCClaimZ_free(_res_conv);
16489 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1ok(JNIEnv *env, jclass clz) {
16490 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
16491 *ret_conv = CResult_NoneNoneZ_ok();
16492 return tag_ptr(ret_conv, true);
16495 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1err(JNIEnv *env, jclass clz) {
16496 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
16497 *ret_conv = CResult_NoneNoneZ_err();
16498 return tag_ptr(ret_conv, true);
16501 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16502 LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)untag_ptr(o);
16503 jboolean ret_conv = CResult_NoneNoneZ_is_ok(o_conv);
16507 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16508 if (!ptr_is_owned(_res)) return;
16509 void* _res_ptr = untag_ptr(_res);
16510 CHECK_ACCESS(_res_ptr);
16511 LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr);
16512 FREE(untag_ptr(_res));
16513 CResult_NoneNoneZ_free(_res_conv);
16516 static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) {
16517 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
16518 *ret_conv = CResult_NoneNoneZ_clone(arg);
16519 return tag_ptr(ret_conv, true);
16521 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16522 LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)untag_ptr(arg);
16523 int64_t ret_conv = CResult_NoneNoneZ_clone_ptr(arg_conv);
16527 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16528 LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)untag_ptr(orig);
16529 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
16530 *ret_conv = CResult_NoneNoneZ_clone(orig_conv);
16531 return tag_ptr(ret_conv, true);
16534 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16535 LDKCounterpartyCommitmentSecrets o_conv;
16536 o_conv.inner = untag_ptr(o);
16537 o_conv.is_owned = ptr_is_owned(o);
16538 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16539 o_conv = CounterpartyCommitmentSecrets_clone(&o_conv);
16540 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
16541 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(o_conv);
16542 return tag_ptr(ret_conv, true);
16545 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16546 void* e_ptr = untag_ptr(e);
16547 CHECK_ACCESS(e_ptr);
16548 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16549 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16550 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
16551 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e_conv);
16552 return tag_ptr(ret_conv, true);
16555 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16556 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* o_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(o);
16557 jboolean ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(o_conv);
16561 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16562 if (!ptr_is_owned(_res)) return;
16563 void* _res_ptr = untag_ptr(_res);
16564 CHECK_ACCESS(_res_ptr);
16565 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)(_res_ptr);
16566 FREE(untag_ptr(_res));
16567 CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(_res_conv);
16570 static inline uint64_t CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR arg) {
16571 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
16572 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(arg);
16573 return tag_ptr(ret_conv, true);
16575 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16576 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(arg);
16577 int64_t ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(arg_conv);
16581 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16582 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(orig);
16583 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
16584 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(orig_conv);
16585 return tag_ptr(ret_conv, true);
16588 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16589 LDKTxCreationKeys o_conv;
16590 o_conv.inner = untag_ptr(o);
16591 o_conv.is_owned = ptr_is_owned(o);
16592 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16593 o_conv = TxCreationKeys_clone(&o_conv);
16594 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
16595 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv);
16596 return tag_ptr(ret_conv, true);
16599 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16600 void* e_ptr = untag_ptr(e);
16601 CHECK_ACCESS(e_ptr);
16602 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16603 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16604 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
16605 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv);
16606 return tag_ptr(ret_conv, true);
16609 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16610 LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(o);
16611 jboolean ret_conv = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv);
16615 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16616 if (!ptr_is_owned(_res)) return;
16617 void* _res_ptr = untag_ptr(_res);
16618 CHECK_ACCESS(_res_ptr);
16619 LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr);
16620 FREE(untag_ptr(_res));
16621 CResult_TxCreationKeysDecodeErrorZ_free(_res_conv);
16624 static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) {
16625 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
16626 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg);
16627 return tag_ptr(ret_conv, true);
16629 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16630 LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(arg);
16631 int64_t ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv);
16635 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16636 LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(orig);
16637 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
16638 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(orig_conv);
16639 return tag_ptr(ret_conv, true);
16642 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16643 LDKChannelPublicKeys o_conv;
16644 o_conv.inner = untag_ptr(o);
16645 o_conv.is_owned = ptr_is_owned(o);
16646 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16647 o_conv = ChannelPublicKeys_clone(&o_conv);
16648 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
16649 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv);
16650 return tag_ptr(ret_conv, true);
16653 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16654 void* e_ptr = untag_ptr(e);
16655 CHECK_ACCESS(e_ptr);
16656 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16657 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16658 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
16659 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv);
16660 return tag_ptr(ret_conv, true);
16663 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16664 LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(o);
16665 jboolean ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv);
16669 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16670 if (!ptr_is_owned(_res)) return;
16671 void* _res_ptr = untag_ptr(_res);
16672 CHECK_ACCESS(_res_ptr);
16673 LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr);
16674 FREE(untag_ptr(_res));
16675 CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv);
16678 static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) {
16679 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
16680 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg);
16681 return tag_ptr(ret_conv, true);
16683 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16684 LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(arg);
16685 int64_t ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv);
16689 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16690 LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(orig);
16691 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
16692 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(orig_conv);
16693 return tag_ptr(ret_conv, true);
16696 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1some(JNIEnv *env, jclass clz, int32_t o) {
16697 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
16698 *ret_copy = COption_u32Z_some(o);
16699 int64_t ret_ref = tag_ptr(ret_copy, true);
16703 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1none(JNIEnv *env, jclass clz) {
16704 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
16705 *ret_copy = COption_u32Z_none();
16706 int64_t ret_ref = tag_ptr(ret_copy, true);
16710 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
16711 if (!ptr_is_owned(_res)) return;
16712 void* _res_ptr = untag_ptr(_res);
16713 CHECK_ACCESS(_res_ptr);
16714 LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(_res_ptr);
16715 FREE(untag_ptr(_res));
16716 COption_u32Z_free(_res_conv);
16719 static inline uint64_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg) {
16720 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
16721 *ret_copy = COption_u32Z_clone(arg);
16722 int64_t ret_ref = tag_ptr(ret_copy, true);
16725 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16726 LDKCOption_u32Z* arg_conv = (LDKCOption_u32Z*)untag_ptr(arg);
16727 int64_t ret_conv = COption_u32Z_clone_ptr(arg_conv);
16731 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16732 LDKCOption_u32Z* orig_conv = (LDKCOption_u32Z*)untag_ptr(orig);
16733 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
16734 *ret_copy = COption_u32Z_clone(orig_conv);
16735 int64_t ret_ref = tag_ptr(ret_copy, true);
16739 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16740 LDKHTLCOutputInCommitment o_conv;
16741 o_conv.inner = untag_ptr(o);
16742 o_conv.is_owned = ptr_is_owned(o);
16743 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16744 o_conv = HTLCOutputInCommitment_clone(&o_conv);
16745 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
16746 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv);
16747 return tag_ptr(ret_conv, true);
16750 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16751 void* e_ptr = untag_ptr(e);
16752 CHECK_ACCESS(e_ptr);
16753 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16754 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16755 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
16756 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv);
16757 return tag_ptr(ret_conv, true);
16760 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16761 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(o);
16762 jboolean ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv);
16766 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16767 if (!ptr_is_owned(_res)) return;
16768 void* _res_ptr = untag_ptr(_res);
16769 CHECK_ACCESS(_res_ptr);
16770 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr);
16771 FREE(untag_ptr(_res));
16772 CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv);
16775 static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) {
16776 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
16777 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg);
16778 return tag_ptr(ret_conv, true);
16780 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16781 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(arg);
16782 int64_t ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv);
16786 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16787 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(orig);
16788 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
16789 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig_conv);
16790 return tag_ptr(ret_conv, true);
16793 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1some(JNIEnv *env, jclass clz) {
16794 jclass ret_conv = LDKCOption_NoneZ_to_java(env, COption_NoneZ_some());
16798 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1none(JNIEnv *env, jclass clz) {
16799 jclass ret_conv = LDKCOption_NoneZ_to_java(env, COption_NoneZ_none());
16803 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NoneZ_1free(JNIEnv *env, jclass clz, jclass _res) {
16804 LDKCOption_NoneZ _res_conv = LDKCOption_NoneZ_from_java(env, _res);
16805 COption_NoneZ_free(_res_conv);
16808 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16809 LDKCounterpartyChannelTransactionParameters o_conv;
16810 o_conv.inner = untag_ptr(o);
16811 o_conv.is_owned = ptr_is_owned(o);
16812 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16813 o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv);
16814 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
16815 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv);
16816 return tag_ptr(ret_conv, true);
16819 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16820 void* e_ptr = untag_ptr(e);
16821 CHECK_ACCESS(e_ptr);
16822 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16823 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16824 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
16825 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv);
16826 return tag_ptr(ret_conv, true);
16829 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16830 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(o);
16831 jboolean ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
16835 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16836 if (!ptr_is_owned(_res)) return;
16837 void* _res_ptr = untag_ptr(_res);
16838 CHECK_ACCESS(_res_ptr);
16839 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
16840 FREE(untag_ptr(_res));
16841 CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv);
16844 static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
16845 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
16846 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg);
16847 return tag_ptr(ret_conv, true);
16849 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16850 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg);
16851 int64_t ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
16855 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16856 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig);
16857 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
16858 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig_conv);
16859 return tag_ptr(ret_conv, true);
16862 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16863 LDKChannelTransactionParameters o_conv;
16864 o_conv.inner = untag_ptr(o);
16865 o_conv.is_owned = ptr_is_owned(o);
16866 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16867 o_conv = ChannelTransactionParameters_clone(&o_conv);
16868 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
16869 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv);
16870 return tag_ptr(ret_conv, true);
16873 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16874 void* e_ptr = untag_ptr(e);
16875 CHECK_ACCESS(e_ptr);
16876 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16877 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16878 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
16879 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv);
16880 return tag_ptr(ret_conv, true);
16883 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16884 LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(o);
16885 jboolean ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
16889 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16890 if (!ptr_is_owned(_res)) return;
16891 void* _res_ptr = untag_ptr(_res);
16892 CHECK_ACCESS(_res_ptr);
16893 LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
16894 FREE(untag_ptr(_res));
16895 CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv);
16898 static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
16899 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
16900 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg);
16901 return tag_ptr(ret_conv, true);
16903 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16904 LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg);
16905 int64_t ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
16909 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16910 LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig);
16911 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
16912 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig_conv);
16913 return tag_ptr(ret_conv, true);
16916 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SignatureZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
16917 LDKCVec_SignatureZ _res_constr;
16918 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
16919 if (_res_constr.datalen > 0)
16920 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
16922 _res_constr.data = NULL;
16923 for (size_t i = 0; i < _res_constr.datalen; i++) {
16924 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
16925 LDKSignature _res_conv_8_ref;
16926 CHECK((*env)->GetArrayLength(env, _res_conv_8) == 64);
16927 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 64, _res_conv_8_ref.compact_form);
16928 _res_constr.data[i] = _res_conv_8_ref;
16930 CVec_SignatureZ_free(_res_constr);
16933 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16934 LDKHolderCommitmentTransaction o_conv;
16935 o_conv.inner = untag_ptr(o);
16936 o_conv.is_owned = ptr_is_owned(o);
16937 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16938 o_conv = HolderCommitmentTransaction_clone(&o_conv);
16939 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
16940 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv);
16941 return tag_ptr(ret_conv, true);
16944 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16945 void* e_ptr = untag_ptr(e);
16946 CHECK_ACCESS(e_ptr);
16947 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
16948 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
16949 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
16950 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv);
16951 return tag_ptr(ret_conv, true);
16954 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
16955 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(o);
16956 jboolean ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
16960 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
16961 if (!ptr_is_owned(_res)) return;
16962 void* _res_ptr = untag_ptr(_res);
16963 CHECK_ACCESS(_res_ptr);
16964 LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr);
16965 FREE(untag_ptr(_res));
16966 CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv);
16969 static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
16970 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
16971 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg);
16972 return tag_ptr(ret_conv, true);
16974 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
16975 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
16976 int64_t ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
16980 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
16981 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
16982 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
16983 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig_conv);
16984 return tag_ptr(ret_conv, true);
16987 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
16988 LDKBuiltCommitmentTransaction o_conv;
16989 o_conv.inner = untag_ptr(o);
16990 o_conv.is_owned = ptr_is_owned(o);
16991 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16992 o_conv = BuiltCommitmentTransaction_clone(&o_conv);
16993 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
16994 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv);
16995 return tag_ptr(ret_conv, true);
16998 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
16999 void* e_ptr = untag_ptr(e);
17000 CHECK_ACCESS(e_ptr);
17001 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17002 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17003 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
17004 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv);
17005 return tag_ptr(ret_conv, true);
17008 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17009 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(o);
17010 jboolean ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
17014 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17015 if (!ptr_is_owned(_res)) return;
17016 void* _res_ptr = untag_ptr(_res);
17017 CHECK_ACCESS(_res_ptr);
17018 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr);
17019 FREE(untag_ptr(_res));
17020 CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv);
17023 static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
17024 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
17025 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg);
17026 return tag_ptr(ret_conv, true);
17028 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17029 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
17030 int64_t ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
17034 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17035 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
17036 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
17037 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig_conv);
17038 return tag_ptr(ret_conv, true);
17041 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17042 LDKTrustedClosingTransaction o_conv;
17043 o_conv.inner = untag_ptr(o);
17044 o_conv.is_owned = ptr_is_owned(o);
17045 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17046 // WARNING: we need a move here but no clone is available for LDKTrustedClosingTransaction
17048 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
17049 *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv);
17050 return tag_ptr(ret_conv, true);
17053 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1err(JNIEnv *env, jclass clz) {
17054 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
17055 *ret_conv = CResult_TrustedClosingTransactionNoneZ_err();
17056 return tag_ptr(ret_conv, true);
17059 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17060 LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(o);
17061 jboolean ret_conv = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv);
17065 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedClosingTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17066 if (!ptr_is_owned(_res)) return;
17067 void* _res_ptr = untag_ptr(_res);
17068 CHECK_ACCESS(_res_ptr);
17069 LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr);
17070 FREE(untag_ptr(_res));
17071 CResult_TrustedClosingTransactionNoneZ_free(_res_conv);
17074 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17075 LDKCommitmentTransaction o_conv;
17076 o_conv.inner = untag_ptr(o);
17077 o_conv.is_owned = ptr_is_owned(o);
17078 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17079 o_conv = CommitmentTransaction_clone(&o_conv);
17080 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
17081 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv);
17082 return tag_ptr(ret_conv, true);
17085 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17086 void* e_ptr = untag_ptr(e);
17087 CHECK_ACCESS(e_ptr);
17088 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17089 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17090 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
17091 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv);
17092 return tag_ptr(ret_conv, true);
17095 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17096 LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(o);
17097 jboolean ret_conv = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv);
17101 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17102 if (!ptr_is_owned(_res)) return;
17103 void* _res_ptr = untag_ptr(_res);
17104 CHECK_ACCESS(_res_ptr);
17105 LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr);
17106 FREE(untag_ptr(_res));
17107 CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv);
17110 static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
17111 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
17112 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg);
17113 return tag_ptr(ret_conv, true);
17115 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17116 LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
17117 int64_t ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
17121 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17122 LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
17123 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
17124 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(orig_conv);
17125 return tag_ptr(ret_conv, true);
17128 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17129 LDKTrustedCommitmentTransaction o_conv;
17130 o_conv.inner = untag_ptr(o);
17131 o_conv.is_owned = ptr_is_owned(o);
17132 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17133 // WARNING: we need a move here but no clone is available for LDKTrustedCommitmentTransaction
17135 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
17136 *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv);
17137 return tag_ptr(ret_conv, true);
17140 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1err(JNIEnv *env, jclass clz) {
17141 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
17142 *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_err();
17143 return tag_ptr(ret_conv, true);
17146 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17147 LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(o);
17148 jboolean ret_conv = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_conv);
17152 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TrustedCommitmentTransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17153 if (!ptr_is_owned(_res)) return;
17154 void* _res_ptr = untag_ptr(_res);
17155 CHECK_ACCESS(_res_ptr);
17156 LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr);
17157 FREE(untag_ptr(_res));
17158 CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv);
17161 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1ok(JNIEnv *env, jclass clz, jobjectArray o) {
17162 LDKCVec_SignatureZ o_constr;
17163 o_constr.datalen = (*env)->GetArrayLength(env, o);
17164 if (o_constr.datalen > 0)
17165 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
17167 o_constr.data = NULL;
17168 for (size_t i = 0; i < o_constr.datalen; i++) {
17169 int8_tArray o_conv_8 = (*env)->GetObjectArrayElement(env, o, i);
17170 LDKSignature o_conv_8_ref;
17171 CHECK((*env)->GetArrayLength(env, o_conv_8) == 64);
17172 (*env)->GetByteArrayRegion(env, o_conv_8, 0, 64, o_conv_8_ref.compact_form);
17173 o_constr.data[i] = o_conv_8_ref;
17175 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
17176 *ret_conv = CResult_CVec_SignatureZNoneZ_ok(o_constr);
17177 return tag_ptr(ret_conv, true);
17180 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err(JNIEnv *env, jclass clz) {
17181 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
17182 *ret_conv = CResult_CVec_SignatureZNoneZ_err();
17183 return tag_ptr(ret_conv, true);
17186 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17187 LDKCResult_CVec_SignatureZNoneZ* o_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(o);
17188 jboolean ret_conv = CResult_CVec_SignatureZNoneZ_is_ok(o_conv);
17192 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17193 if (!ptr_is_owned(_res)) return;
17194 void* _res_ptr = untag_ptr(_res);
17195 CHECK_ACCESS(_res_ptr);
17196 LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)(_res_ptr);
17197 FREE(untag_ptr(_res));
17198 CResult_CVec_SignatureZNoneZ_free(_res_conv);
17201 static inline uint64_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg) {
17202 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
17203 *ret_conv = CResult_CVec_SignatureZNoneZ_clone(arg);
17204 return tag_ptr(ret_conv, true);
17206 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17207 LDKCResult_CVec_SignatureZNoneZ* arg_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(arg);
17208 int64_t ret_conv = CResult_CVec_SignatureZNoneZ_clone_ptr(arg_conv);
17212 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17213 LDKCResult_CVec_SignatureZNoneZ* orig_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(orig);
17214 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
17215 *ret_conv = CResult_CVec_SignatureZNoneZ_clone(orig_conv);
17216 return tag_ptr(ret_conv, true);
17219 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17220 LDKShutdownScript o_conv;
17221 o_conv.inner = untag_ptr(o);
17222 o_conv.is_owned = ptr_is_owned(o);
17223 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17224 o_conv = ShutdownScript_clone(&o_conv);
17225 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
17226 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv);
17227 return tag_ptr(ret_conv, true);
17230 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17231 void* e_ptr = untag_ptr(e);
17232 CHECK_ACCESS(e_ptr);
17233 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17234 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17235 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
17236 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv);
17237 return tag_ptr(ret_conv, true);
17240 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17241 LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(o);
17242 jboolean ret_conv = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv);
17246 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17247 if (!ptr_is_owned(_res)) return;
17248 void* _res_ptr = untag_ptr(_res);
17249 CHECK_ACCESS(_res_ptr);
17250 LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr);
17251 FREE(untag_ptr(_res));
17252 CResult_ShutdownScriptDecodeErrorZ_free(_res_conv);
17255 static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) {
17256 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
17257 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg);
17258 return tag_ptr(ret_conv, true);
17260 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17261 LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(arg);
17262 int64_t ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv);
17266 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17267 LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(orig);
17268 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
17269 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(orig_conv);
17270 return tag_ptr(ret_conv, true);
17273 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17274 LDKShutdownScript o_conv;
17275 o_conv.inner = untag_ptr(o);
17276 o_conv.is_owned = ptr_is_owned(o);
17277 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17278 o_conv = ShutdownScript_clone(&o_conv);
17279 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
17280 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv);
17281 return tag_ptr(ret_conv, true);
17284 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17285 LDKInvalidShutdownScript e_conv;
17286 e_conv.inner = untag_ptr(e);
17287 e_conv.is_owned = ptr_is_owned(e);
17288 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17289 e_conv = InvalidShutdownScript_clone(&e_conv);
17290 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
17291 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv);
17292 return tag_ptr(ret_conv, true);
17295 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17296 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(o);
17297 jboolean ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv);
17301 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17302 if (!ptr_is_owned(_res)) return;
17303 void* _res_ptr = untag_ptr(_res);
17304 CHECK_ACCESS(_res_ptr);
17305 LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr);
17306 FREE(untag_ptr(_res));
17307 CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv);
17310 static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) {
17311 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
17312 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg);
17313 return tag_ptr(ret_conv, true);
17315 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17316 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(arg);
17317 int64_t ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv);
17321 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17322 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(orig);
17323 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
17324 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv);
17325 return tag_ptr(ret_conv, true);
17328 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17329 LDKBlindedPayInfo o_conv;
17330 o_conv.inner = untag_ptr(o);
17331 o_conv.is_owned = ptr_is_owned(o);
17332 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17333 o_conv = BlindedPayInfo_clone(&o_conv);
17334 LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ");
17335 *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_ok(o_conv);
17336 return tag_ptr(ret_conv, true);
17339 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17340 void* e_ptr = untag_ptr(e);
17341 CHECK_ACCESS(e_ptr);
17342 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17343 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17344 LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ");
17345 *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_err(e_conv);
17346 return tag_ptr(ret_conv, true);
17349 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17350 LDKCResult_BlindedPayInfoDecodeErrorZ* o_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(o);
17351 jboolean ret_conv = CResult_BlindedPayInfoDecodeErrorZ_is_ok(o_conv);
17355 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17356 if (!ptr_is_owned(_res)) return;
17357 void* _res_ptr = untag_ptr(_res);
17358 CHECK_ACCESS(_res_ptr);
17359 LDKCResult_BlindedPayInfoDecodeErrorZ _res_conv = *(LDKCResult_BlindedPayInfoDecodeErrorZ*)(_res_ptr);
17360 FREE(untag_ptr(_res));
17361 CResult_BlindedPayInfoDecodeErrorZ_free(_res_conv);
17364 static inline uint64_t CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR arg) {
17365 LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ");
17366 *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone(arg);
17367 return tag_ptr(ret_conv, true);
17369 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17370 LDKCResult_BlindedPayInfoDecodeErrorZ* arg_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(arg);
17371 int64_t ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone_ptr(arg_conv);
17375 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPayInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17376 LDKCResult_BlindedPayInfoDecodeErrorZ* orig_conv = (LDKCResult_BlindedPayInfoDecodeErrorZ*)untag_ptr(orig);
17377 LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ");
17378 *ret_conv = CResult_BlindedPayInfoDecodeErrorZ_clone(orig_conv);
17379 return tag_ptr(ret_conv, true);
17382 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1WriteableScoreZ_1some(JNIEnv *env, jclass clz, int64_t o) {
17383 void* o_ptr = untag_ptr(o);
17384 CHECK_ACCESS(o_ptr);
17385 LDKWriteableScore o_conv = *(LDKWriteableScore*)(o_ptr);
17386 if (o_conv.free == LDKWriteableScore_JCalls_free) {
17387 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
17388 LDKWriteableScore_JCalls_cloned(&o_conv);
17390 LDKCOption_WriteableScoreZ *ret_copy = MALLOC(sizeof(LDKCOption_WriteableScoreZ), "LDKCOption_WriteableScoreZ");
17391 *ret_copy = COption_WriteableScoreZ_some(o_conv);
17392 int64_t ret_ref = tag_ptr(ret_copy, true);
17396 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1WriteableScoreZ_1none(JNIEnv *env, jclass clz) {
17397 LDKCOption_WriteableScoreZ *ret_copy = MALLOC(sizeof(LDKCOption_WriteableScoreZ), "LDKCOption_WriteableScoreZ");
17398 *ret_copy = COption_WriteableScoreZ_none();
17399 int64_t ret_ref = tag_ptr(ret_copy, true);
17403 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1WriteableScoreZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17404 if (!ptr_is_owned(_res)) return;
17405 void* _res_ptr = untag_ptr(_res);
17406 CHECK_ACCESS(_res_ptr);
17407 LDKCOption_WriteableScoreZ _res_conv = *(LDKCOption_WriteableScoreZ*)(_res_ptr);
17408 FREE(untag_ptr(_res));
17409 COption_WriteableScoreZ_free(_res_conv);
17412 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1ok(JNIEnv *env, jclass clz) {
17413 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17414 *ret_conv = CResult_NoneErrorZ_ok();
17415 return tag_ptr(ret_conv, true);
17418 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
17419 LDKIOError e_conv = LDKIOError_from_java(env, e);
17420 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17421 *ret_conv = CResult_NoneErrorZ_err(e_conv);
17422 return tag_ptr(ret_conv, true);
17425 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17426 LDKCResult_NoneErrorZ* o_conv = (LDKCResult_NoneErrorZ*)untag_ptr(o);
17427 jboolean ret_conv = CResult_NoneErrorZ_is_ok(o_conv);
17431 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17432 if (!ptr_is_owned(_res)) return;
17433 void* _res_ptr = untag_ptr(_res);
17434 CHECK_ACCESS(_res_ptr);
17435 LDKCResult_NoneErrorZ _res_conv = *(LDKCResult_NoneErrorZ*)(_res_ptr);
17436 FREE(untag_ptr(_res));
17437 CResult_NoneErrorZ_free(_res_conv);
17440 static inline uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg) {
17441 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17442 *ret_conv = CResult_NoneErrorZ_clone(arg);
17443 return tag_ptr(ret_conv, true);
17445 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17446 LDKCResult_NoneErrorZ* arg_conv = (LDKCResult_NoneErrorZ*)untag_ptr(arg);
17447 int64_t ret_conv = CResult_NoneErrorZ_clone_ptr(arg_conv);
17451 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17452 LDKCResult_NoneErrorZ* orig_conv = (LDKCResult_NoneErrorZ*)untag_ptr(orig);
17453 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17454 *ret_conv = CResult_NoneErrorZ_clone(orig_conv);
17455 return tag_ptr(ret_conv, true);
17458 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17459 LDKCVec_ChannelDetailsZ _res_constr;
17460 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17461 if (_res_constr.datalen > 0)
17462 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
17464 _res_constr.data = NULL;
17465 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
17466 for (size_t q = 0; q < _res_constr.datalen; q++) {
17467 int64_t _res_conv_16 = _res_vals[q];
17468 LDKChannelDetails _res_conv_16_conv;
17469 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
17470 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
17471 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
17472 _res_constr.data[q] = _res_conv_16_conv;
17474 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
17475 CVec_ChannelDetailsZ_free(_res_constr);
17478 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17480 o_conv.inner = untag_ptr(o);
17481 o_conv.is_owned = ptr_is_owned(o);
17482 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17483 o_conv = Route_clone(&o_conv);
17484 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
17485 *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
17486 return tag_ptr(ret_conv, true);
17489 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17490 LDKLightningError e_conv;
17491 e_conv.inner = untag_ptr(e);
17492 e_conv.is_owned = ptr_is_owned(e);
17493 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17494 e_conv = LightningError_clone(&e_conv);
17495 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
17496 *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
17497 return tag_ptr(ret_conv, true);
17500 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17501 LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(o);
17502 jboolean ret_conv = CResult_RouteLightningErrorZ_is_ok(o_conv);
17506 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17507 if (!ptr_is_owned(_res)) return;
17508 void* _res_ptr = untag_ptr(_res);
17509 CHECK_ACCESS(_res_ptr);
17510 LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
17511 FREE(untag_ptr(_res));
17512 CResult_RouteLightningErrorZ_free(_res_conv);
17515 static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) {
17516 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
17517 *ret_conv = CResult_RouteLightningErrorZ_clone(arg);
17518 return tag_ptr(ret_conv, true);
17520 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17521 LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(arg);
17522 int64_t ret_conv = CResult_RouteLightningErrorZ_clone_ptr(arg_conv);
17526 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17527 LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(orig);
17528 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
17529 *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv);
17530 return tag_ptr(ret_conv, true);
17533 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17534 LDKInFlightHtlcs o_conv;
17535 o_conv.inner = untag_ptr(o);
17536 o_conv.is_owned = ptr_is_owned(o);
17537 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17538 o_conv = InFlightHtlcs_clone(&o_conv);
17539 LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
17540 *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_ok(o_conv);
17541 return tag_ptr(ret_conv, true);
17544 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17545 void* e_ptr = untag_ptr(e);
17546 CHECK_ACCESS(e_ptr);
17547 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17548 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17549 LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
17550 *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_err(e_conv);
17551 return tag_ptr(ret_conv, true);
17554 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17555 LDKCResult_InFlightHtlcsDecodeErrorZ* o_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(o);
17556 jboolean ret_conv = CResult_InFlightHtlcsDecodeErrorZ_is_ok(o_conv);
17560 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17561 if (!ptr_is_owned(_res)) return;
17562 void* _res_ptr = untag_ptr(_res);
17563 CHECK_ACCESS(_res_ptr);
17564 LDKCResult_InFlightHtlcsDecodeErrorZ _res_conv = *(LDKCResult_InFlightHtlcsDecodeErrorZ*)(_res_ptr);
17565 FREE(untag_ptr(_res));
17566 CResult_InFlightHtlcsDecodeErrorZ_free(_res_conv);
17569 static inline uint64_t CResult_InFlightHtlcsDecodeErrorZ_clone_ptr(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR arg) {
17570 LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
17571 *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_clone(arg);
17572 return tag_ptr(ret_conv, true);
17574 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17575 LDKCResult_InFlightHtlcsDecodeErrorZ* arg_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(arg);
17576 int64_t ret_conv = CResult_InFlightHtlcsDecodeErrorZ_clone_ptr(arg_conv);
17580 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17581 LDKCResult_InFlightHtlcsDecodeErrorZ* orig_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(orig);
17582 LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
17583 *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_clone(orig_conv);
17584 return tag_ptr(ret_conv, true);
17587 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17588 LDKRouteHop o_conv;
17589 o_conv.inner = untag_ptr(o);
17590 o_conv.is_owned = ptr_is_owned(o);
17591 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17592 o_conv = RouteHop_clone(&o_conv);
17593 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
17594 *ret_conv = CResult_RouteHopDecodeErrorZ_ok(o_conv);
17595 return tag_ptr(ret_conv, true);
17598 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17599 void* e_ptr = untag_ptr(e);
17600 CHECK_ACCESS(e_ptr);
17601 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17602 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17603 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
17604 *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv);
17605 return tag_ptr(ret_conv, true);
17608 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17609 LDKCResult_RouteHopDecodeErrorZ* o_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(o);
17610 jboolean ret_conv = CResult_RouteHopDecodeErrorZ_is_ok(o_conv);
17614 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17615 if (!ptr_is_owned(_res)) return;
17616 void* _res_ptr = untag_ptr(_res);
17617 CHECK_ACCESS(_res_ptr);
17618 LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(_res_ptr);
17619 FREE(untag_ptr(_res));
17620 CResult_RouteHopDecodeErrorZ_free(_res_conv);
17623 static inline uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg) {
17624 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
17625 *ret_conv = CResult_RouteHopDecodeErrorZ_clone(arg);
17626 return tag_ptr(ret_conv, true);
17628 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17629 LDKCResult_RouteHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(arg);
17630 int64_t ret_conv = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv);
17634 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17635 LDKCResult_RouteHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(orig);
17636 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
17637 *ret_conv = CResult_RouteHopDecodeErrorZ_clone(orig_conv);
17638 return tag_ptr(ret_conv, true);
17641 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BlindedHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17642 LDKCVec_BlindedHopZ _res_constr;
17643 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17644 if (_res_constr.datalen > 0)
17645 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements");
17647 _res_constr.data = NULL;
17648 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
17649 for (size_t m = 0; m < _res_constr.datalen; m++) {
17650 int64_t _res_conv_12 = _res_vals[m];
17651 LDKBlindedHop _res_conv_12_conv;
17652 _res_conv_12_conv.inner = untag_ptr(_res_conv_12);
17653 _res_conv_12_conv.is_owned = ptr_is_owned(_res_conv_12);
17654 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_12_conv);
17655 _res_constr.data[m] = _res_conv_12_conv;
17657 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
17658 CVec_BlindedHopZ_free(_res_constr);
17661 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedTailDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17662 LDKBlindedTail o_conv;
17663 o_conv.inner = untag_ptr(o);
17664 o_conv.is_owned = ptr_is_owned(o);
17665 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17666 o_conv = BlindedTail_clone(&o_conv);
17667 LDKCResult_BlindedTailDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedTailDecodeErrorZ), "LDKCResult_BlindedTailDecodeErrorZ");
17668 *ret_conv = CResult_BlindedTailDecodeErrorZ_ok(o_conv);
17669 return tag_ptr(ret_conv, true);
17672 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedTailDecodeErrorZ_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_BlindedTailDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedTailDecodeErrorZ), "LDKCResult_BlindedTailDecodeErrorZ");
17678 *ret_conv = CResult_BlindedTailDecodeErrorZ_err(e_conv);
17679 return tag_ptr(ret_conv, true);
17682 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedTailDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17683 LDKCResult_BlindedTailDecodeErrorZ* o_conv = (LDKCResult_BlindedTailDecodeErrorZ*)untag_ptr(o);
17684 jboolean ret_conv = CResult_BlindedTailDecodeErrorZ_is_ok(o_conv);
17688 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedTailDecodeErrorZ_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_BlindedTailDecodeErrorZ _res_conv = *(LDKCResult_BlindedTailDecodeErrorZ*)(_res_ptr);
17693 FREE(untag_ptr(_res));
17694 CResult_BlindedTailDecodeErrorZ_free(_res_conv);
17697 static inline uint64_t CResult_BlindedTailDecodeErrorZ_clone_ptr(LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR arg) {
17698 LDKCResult_BlindedTailDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedTailDecodeErrorZ), "LDKCResult_BlindedTailDecodeErrorZ");
17699 *ret_conv = CResult_BlindedTailDecodeErrorZ_clone(arg);
17700 return tag_ptr(ret_conv, true);
17702 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedTailDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17703 LDKCResult_BlindedTailDecodeErrorZ* arg_conv = (LDKCResult_BlindedTailDecodeErrorZ*)untag_ptr(arg);
17704 int64_t ret_conv = CResult_BlindedTailDecodeErrorZ_clone_ptr(arg_conv);
17708 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedTailDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17709 LDKCResult_BlindedTailDecodeErrorZ* orig_conv = (LDKCResult_BlindedTailDecodeErrorZ*)untag_ptr(orig);
17710 LDKCResult_BlindedTailDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedTailDecodeErrorZ), "LDKCResult_BlindedTailDecodeErrorZ");
17711 *ret_conv = CResult_BlindedTailDecodeErrorZ_clone(orig_conv);
17712 return tag_ptr(ret_conv, true);
17715 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17716 LDKCVec_RouteHopZ _res_constr;
17717 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17718 if (_res_constr.datalen > 0)
17719 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
17721 _res_constr.data = NULL;
17722 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
17723 for (size_t k = 0; k < _res_constr.datalen; k++) {
17724 int64_t _res_conv_10 = _res_vals[k];
17725 LDKRouteHop _res_conv_10_conv;
17726 _res_conv_10_conv.inner = untag_ptr(_res_conv_10);
17727 _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10);
17728 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
17729 _res_constr.data[k] = _res_conv_10_conv;
17731 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
17732 CVec_RouteHopZ_free(_res_constr);
17735 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PathZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17736 LDKCVec_PathZ _res_constr;
17737 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17738 if (_res_constr.datalen > 0)
17739 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements");
17741 _res_constr.data = NULL;
17742 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
17743 for (size_t g = 0; g < _res_constr.datalen; g++) {
17744 int64_t _res_conv_6 = _res_vals[g];
17745 LDKPath _res_conv_6_conv;
17746 _res_conv_6_conv.inner = untag_ptr(_res_conv_6);
17747 _res_conv_6_conv.is_owned = ptr_is_owned(_res_conv_6);
17748 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_6_conv);
17749 _res_constr.data[g] = _res_conv_6_conv;
17751 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
17752 CVec_PathZ_free(_res_constr);
17755 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17757 o_conv.inner = untag_ptr(o);
17758 o_conv.is_owned = ptr_is_owned(o);
17759 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17760 o_conv = Route_clone(&o_conv);
17761 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
17762 *ret_conv = CResult_RouteDecodeErrorZ_ok(o_conv);
17763 return tag_ptr(ret_conv, true);
17766 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17767 void* e_ptr = untag_ptr(e);
17768 CHECK_ACCESS(e_ptr);
17769 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17770 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17771 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
17772 *ret_conv = CResult_RouteDecodeErrorZ_err(e_conv);
17773 return tag_ptr(ret_conv, true);
17776 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17777 LDKCResult_RouteDecodeErrorZ* o_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(o);
17778 jboolean ret_conv = CResult_RouteDecodeErrorZ_is_ok(o_conv);
17782 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17783 if (!ptr_is_owned(_res)) return;
17784 void* _res_ptr = untag_ptr(_res);
17785 CHECK_ACCESS(_res_ptr);
17786 LDKCResult_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)(_res_ptr);
17787 FREE(untag_ptr(_res));
17788 CResult_RouteDecodeErrorZ_free(_res_conv);
17791 static inline uint64_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg) {
17792 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
17793 *ret_conv = CResult_RouteDecodeErrorZ_clone(arg);
17794 return tag_ptr(ret_conv, true);
17796 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17797 LDKCResult_RouteDecodeErrorZ* arg_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(arg);
17798 int64_t ret_conv = CResult_RouteDecodeErrorZ_clone_ptr(arg_conv);
17802 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17803 LDKCResult_RouteDecodeErrorZ* orig_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(orig);
17804 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
17805 *ret_conv = CResult_RouteDecodeErrorZ_clone(orig_conv);
17806 return tag_ptr(ret_conv, true);
17809 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17810 LDKRouteParameters o_conv;
17811 o_conv.inner = untag_ptr(o);
17812 o_conv.is_owned = ptr_is_owned(o);
17813 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17814 o_conv = RouteParameters_clone(&o_conv);
17815 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
17816 *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv);
17817 return tag_ptr(ret_conv, true);
17820 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17821 void* e_ptr = untag_ptr(e);
17822 CHECK_ACCESS(e_ptr);
17823 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17824 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17825 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
17826 *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv);
17827 return tag_ptr(ret_conv, true);
17830 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17831 LDKCResult_RouteParametersDecodeErrorZ* o_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(o);
17832 jboolean ret_conv = CResult_RouteParametersDecodeErrorZ_is_ok(o_conv);
17836 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17837 if (!ptr_is_owned(_res)) return;
17838 void* _res_ptr = untag_ptr(_res);
17839 CHECK_ACCESS(_res_ptr);
17840 LDKCResult_RouteParametersDecodeErrorZ _res_conv = *(LDKCResult_RouteParametersDecodeErrorZ*)(_res_ptr);
17841 FREE(untag_ptr(_res));
17842 CResult_RouteParametersDecodeErrorZ_free(_res_conv);
17845 static inline uint64_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg) {
17846 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
17847 *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(arg);
17848 return tag_ptr(ret_conv, true);
17850 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17851 LDKCResult_RouteParametersDecodeErrorZ* arg_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(arg);
17852 int64_t ret_conv = CResult_RouteParametersDecodeErrorZ_clone_ptr(arg_conv);
17856 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17857 LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(orig);
17858 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
17859 *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(orig_conv);
17860 return tag_ptr(ret_conv, true);
17863 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17864 LDKCVec_u64Z _res_constr;
17865 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17866 if (_res_constr.datalen > 0)
17867 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
17869 _res_constr.data = NULL;
17870 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
17871 for (size_t g = 0; g < _res_constr.datalen; g++) {
17872 int64_t _res_conv_6 = _res_vals[g];
17873 _res_constr.data[g] = _res_conv_6;
17875 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
17876 CVec_u64Z_free(_res_constr);
17879 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
17880 LDKPaymentParameters o_conv;
17881 o_conv.inner = untag_ptr(o);
17882 o_conv.is_owned = ptr_is_owned(o);
17883 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17884 o_conv = PaymentParameters_clone(&o_conv);
17885 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
17886 *ret_conv = CResult_PaymentParametersDecodeErrorZ_ok(o_conv);
17887 return tag_ptr(ret_conv, true);
17890 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
17891 void* e_ptr = untag_ptr(e);
17892 CHECK_ACCESS(e_ptr);
17893 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
17894 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
17895 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
17896 *ret_conv = CResult_PaymentParametersDecodeErrorZ_err(e_conv);
17897 return tag_ptr(ret_conv, true);
17900 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
17901 LDKCResult_PaymentParametersDecodeErrorZ* o_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(o);
17902 jboolean ret_conv = CResult_PaymentParametersDecodeErrorZ_is_ok(o_conv);
17906 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17907 if (!ptr_is_owned(_res)) return;
17908 void* _res_ptr = untag_ptr(_res);
17909 CHECK_ACCESS(_res_ptr);
17910 LDKCResult_PaymentParametersDecodeErrorZ _res_conv = *(LDKCResult_PaymentParametersDecodeErrorZ*)(_res_ptr);
17911 FREE(untag_ptr(_res));
17912 CResult_PaymentParametersDecodeErrorZ_free(_res_conv);
17915 static inline uint64_t CResult_PaymentParametersDecodeErrorZ_clone_ptr(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR arg) {
17916 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
17917 *ret_conv = CResult_PaymentParametersDecodeErrorZ_clone(arg);
17918 return tag_ptr(ret_conv, true);
17920 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17921 LDKCResult_PaymentParametersDecodeErrorZ* arg_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(arg);
17922 int64_t ret_conv = CResult_PaymentParametersDecodeErrorZ_clone_ptr(arg_conv);
17926 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17927 LDKCResult_PaymentParametersDecodeErrorZ* orig_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(orig);
17928 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
17929 *ret_conv = CResult_PaymentParametersDecodeErrorZ_clone(orig_conv);
17930 return tag_ptr(ret_conv, true);
17933 static inline uint64_t C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR arg) {
17934 LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ");
17935 *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(arg);
17936 return tag_ptr(ret_conv, true);
17938 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
17939 LDKC2Tuple_BlindedPayInfoBlindedPathZ* arg_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(arg);
17940 int64_t ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone_ptr(arg_conv);
17944 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
17945 LDKC2Tuple_BlindedPayInfoBlindedPathZ* orig_conv = (LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(orig);
17946 LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ");
17947 *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone(orig_conv);
17948 return tag_ptr(ret_conv, true);
17951 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
17952 LDKBlindedPayInfo a_conv;
17953 a_conv.inner = untag_ptr(a);
17954 a_conv.is_owned = ptr_is_owned(a);
17955 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
17956 a_conv = BlindedPayInfo_clone(&a_conv);
17957 LDKBlindedPath b_conv;
17958 b_conv.inner = untag_ptr(b);
17959 b_conv.is_owned = ptr_is_owned(b);
17960 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
17961 b_conv = BlindedPath_clone(&b_conv);
17962 LDKC2Tuple_BlindedPayInfoBlindedPathZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKC2Tuple_BlindedPayInfoBlindedPathZ");
17963 *ret_conv = C2Tuple_BlindedPayInfoBlindedPathZ_new(a_conv, b_conv);
17964 return tag_ptr(ret_conv, true);
17967 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlindedPayInfoBlindedPathZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
17968 if (!ptr_is_owned(_res)) return;
17969 void* _res_ptr = untag_ptr(_res);
17970 CHECK_ACCESS(_res_ptr);
17971 LDKC2Tuple_BlindedPayInfoBlindedPathZ _res_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(_res_ptr);
17972 FREE(untag_ptr(_res));
17973 C2Tuple_BlindedPayInfoBlindedPathZ_free(_res_conv);
17976 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1BlindedPayInfoBlindedPathZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17977 LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res_constr;
17978 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17979 if (_res_constr.datalen > 0)
17980 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements");
17982 _res_constr.data = NULL;
17983 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
17984 for (size_t l = 0; l < _res_constr.datalen; l++) {
17985 int64_t _res_conv_37 = _res_vals[l];
17986 void* _res_conv_37_ptr = untag_ptr(_res_conv_37);
17987 CHECK_ACCESS(_res_conv_37_ptr);
17988 LDKC2Tuple_BlindedPayInfoBlindedPathZ _res_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(_res_conv_37_ptr);
17989 FREE(untag_ptr(_res_conv_37));
17990 _res_constr.data[l] = _res_conv_37_conv;
17992 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
17993 CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(_res_constr);
17996 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
17997 LDKCVec_RouteHintZ _res_constr;
17998 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
17999 if (_res_constr.datalen > 0)
18000 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
18002 _res_constr.data = NULL;
18003 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
18004 for (size_t l = 0; l < _res_constr.datalen; l++) {
18005 int64_t _res_conv_11 = _res_vals[l];
18006 LDKRouteHint _res_conv_11_conv;
18007 _res_conv_11_conv.inner = untag_ptr(_res_conv_11);
18008 _res_conv_11_conv.is_owned = ptr_is_owned(_res_conv_11);
18009 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv);
18010 _res_constr.data[l] = _res_conv_11_conv;
18012 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
18013 CVec_RouteHintZ_free(_res_constr);
18016 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
18017 LDKCVec_RouteHintHopZ _res_constr;
18018 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
18019 if (_res_constr.datalen > 0)
18020 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
18022 _res_constr.data = NULL;
18023 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
18024 for (size_t o = 0; o < _res_constr.datalen; o++) {
18025 int64_t _res_conv_14 = _res_vals[o];
18026 LDKRouteHintHop _res_conv_14_conv;
18027 _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
18028 _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
18029 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
18030 _res_constr.data[o] = _res_conv_14_conv;
18032 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
18033 CVec_RouteHintHopZ_free(_res_constr);
18036 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18037 LDKRouteHint o_conv;
18038 o_conv.inner = untag_ptr(o);
18039 o_conv.is_owned = ptr_is_owned(o);
18040 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18041 o_conv = RouteHint_clone(&o_conv);
18042 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
18043 *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv);
18044 return tag_ptr(ret_conv, true);
18047 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18048 void* e_ptr = untag_ptr(e);
18049 CHECK_ACCESS(e_ptr);
18050 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18051 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18052 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
18053 *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv);
18054 return tag_ptr(ret_conv, true);
18057 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18058 LDKCResult_RouteHintDecodeErrorZ* o_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(o);
18059 jboolean ret_conv = CResult_RouteHintDecodeErrorZ_is_ok(o_conv);
18063 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18064 if (!ptr_is_owned(_res)) return;
18065 void* _res_ptr = untag_ptr(_res);
18066 CHECK_ACCESS(_res_ptr);
18067 LDKCResult_RouteHintDecodeErrorZ _res_conv = *(LDKCResult_RouteHintDecodeErrorZ*)(_res_ptr);
18068 FREE(untag_ptr(_res));
18069 CResult_RouteHintDecodeErrorZ_free(_res_conv);
18072 static inline uint64_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg) {
18073 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
18074 *ret_conv = CResult_RouteHintDecodeErrorZ_clone(arg);
18075 return tag_ptr(ret_conv, true);
18077 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18078 LDKCResult_RouteHintDecodeErrorZ* arg_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(arg);
18079 int64_t ret_conv = CResult_RouteHintDecodeErrorZ_clone_ptr(arg_conv);
18083 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18084 LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(orig);
18085 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
18086 *ret_conv = CResult_RouteHintDecodeErrorZ_clone(orig_conv);
18087 return tag_ptr(ret_conv, true);
18090 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18091 LDKRouteHintHop o_conv;
18092 o_conv.inner = untag_ptr(o);
18093 o_conv.is_owned = ptr_is_owned(o);
18094 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18095 o_conv = RouteHintHop_clone(&o_conv);
18096 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
18097 *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv);
18098 return tag_ptr(ret_conv, true);
18101 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18102 void* e_ptr = untag_ptr(e);
18103 CHECK_ACCESS(e_ptr);
18104 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18105 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18106 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
18107 *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv);
18108 return tag_ptr(ret_conv, true);
18111 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18112 LDKCResult_RouteHintHopDecodeErrorZ* o_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(o);
18113 jboolean ret_conv = CResult_RouteHintHopDecodeErrorZ_is_ok(o_conv);
18117 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18118 if (!ptr_is_owned(_res)) return;
18119 void* _res_ptr = untag_ptr(_res);
18120 CHECK_ACCESS(_res_ptr);
18121 LDKCResult_RouteHintHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHintHopDecodeErrorZ*)(_res_ptr);
18122 FREE(untag_ptr(_res));
18123 CResult_RouteHintHopDecodeErrorZ_free(_res_conv);
18126 static inline uint64_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg) {
18127 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
18128 *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(arg);
18129 return tag_ptr(ret_conv, true);
18131 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18132 LDKCResult_RouteHintHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(arg);
18133 int64_t ret_conv = CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg_conv);
18137 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18138 LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(orig);
18139 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
18140 *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(orig_conv);
18141 return tag_ptr(ret_conv, true);
18144 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
18145 LDKCVec_PublicKeyZ _res_constr;
18146 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
18147 if (_res_constr.datalen > 0)
18148 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
18150 _res_constr.data = NULL;
18151 for (size_t i = 0; i < _res_constr.datalen; i++) {
18152 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
18153 LDKPublicKey _res_conv_8_ref;
18154 CHECK((*env)->GetArrayLength(env, _res_conv_8) == 33);
18155 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 33, _res_conv_8_ref.compressed_form);
18156 _res_constr.data[i] = _res_conv_8_ref;
18158 CVec_PublicKeyZ_free(_res_constr);
18161 static inline uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) {
18162 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
18163 *ret_conv = C2Tuple_usizeTransactionZ_clone(arg);
18164 return tag_ptr(ret_conv, true);
18166 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18167 LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(arg);
18168 int64_t ret_conv = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv);
18172 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18173 LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(orig);
18174 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
18175 *ret_conv = C2Tuple_usizeTransactionZ_clone(orig_conv);
18176 return tag_ptr(ret_conv, true);
18179 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) {
18180 LDKTransaction b_ref;
18181 b_ref.datalen = (*env)->GetArrayLength(env, b);
18182 b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes");
18183 (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data);
18184 b_ref.data_is_owned = true;
18185 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
18186 *ret_conv = C2Tuple_usizeTransactionZ_new(a, b_ref);
18187 return tag_ptr(ret_conv, true);
18190 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18191 if (!ptr_is_owned(_res)) return;
18192 void* _res_ptr = untag_ptr(_res);
18193 CHECK_ACCESS(_res_ptr);
18194 LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr);
18195 FREE(untag_ptr(_res));
18196 C2Tuple_usizeTransactionZ_free(_res_conv);
18199 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
18200 LDKCVec_C2Tuple_usizeTransactionZZ _res_constr;
18201 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
18202 if (_res_constr.datalen > 0)
18203 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
18205 _res_constr.data = NULL;
18206 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
18207 for (size_t c = 0; c < _res_constr.datalen; c++) {
18208 int64_t _res_conv_28 = _res_vals[c];
18209 void* _res_conv_28_ptr = untag_ptr(_res_conv_28);
18210 CHECK_ACCESS(_res_conv_28_ptr);
18211 LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr);
18212 FREE(untag_ptr(_res_conv_28));
18213 _res_constr.data[c] = _res_conv_28_conv;
18215 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
18216 CVec_C2Tuple_usizeTransactionZZ_free(_res_constr);
18219 static inline uint64_t C2Tuple_TxidBlockHashZ_clone_ptr(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR arg) {
18220 LDKC2Tuple_TxidBlockHashZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ");
18221 *ret_conv = C2Tuple_TxidBlockHashZ_clone(arg);
18222 return tag_ptr(ret_conv, true);
18224 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18225 LDKC2Tuple_TxidBlockHashZ* arg_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(arg);
18226 int64_t ret_conv = C2Tuple_TxidBlockHashZ_clone_ptr(arg_conv);
18230 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18231 LDKC2Tuple_TxidBlockHashZ* orig_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(orig);
18232 LDKC2Tuple_TxidBlockHashZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ");
18233 *ret_conv = C2Tuple_TxidBlockHashZ_clone(orig_conv);
18234 return tag_ptr(ret_conv, true);
18237 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) {
18238 LDKThirtyTwoBytes a_ref;
18239 CHECK((*env)->GetArrayLength(env, a) == 32);
18240 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
18241 LDKThirtyTwoBytes b_ref;
18242 CHECK((*env)->GetArrayLength(env, b) == 32);
18243 (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
18244 LDKC2Tuple_TxidBlockHashZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ");
18245 *ret_conv = C2Tuple_TxidBlockHashZ_new(a_ref, b_ref);
18246 return tag_ptr(ret_conv, true);
18249 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18250 if (!ptr_is_owned(_res)) return;
18251 void* _res_ptr = untag_ptr(_res);
18252 CHECK_ACCESS(_res_ptr);
18253 LDKC2Tuple_TxidBlockHashZ _res_conv = *(LDKC2Tuple_TxidBlockHashZ*)(_res_ptr);
18254 FREE(untag_ptr(_res));
18255 C2Tuple_TxidBlockHashZ_free(_res_conv);
18258 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidBlockHashZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
18259 LDKCVec_C2Tuple_TxidBlockHashZZ _res_constr;
18260 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
18261 if (_res_constr.datalen > 0)
18262 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKCVec_C2Tuple_TxidBlockHashZZ Elements");
18264 _res_constr.data = NULL;
18265 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
18266 for (size_t z = 0; z < _res_constr.datalen; z++) {
18267 int64_t _res_conv_25 = _res_vals[z];
18268 void* _res_conv_25_ptr = untag_ptr(_res_conv_25);
18269 CHECK_ACCESS(_res_conv_25_ptr);
18270 LDKC2Tuple_TxidBlockHashZ _res_conv_25_conv = *(LDKC2Tuple_TxidBlockHashZ*)(_res_conv_25_ptr);
18271 FREE(untag_ptr(_res_conv_25));
18272 _res_constr.data[z] = _res_conv_25_conv;
18274 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
18275 CVec_C2Tuple_TxidBlockHashZZ_free(_res_constr);
18278 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
18279 LDKCVec_MonitorEventZ _res_constr;
18280 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
18281 if (_res_constr.datalen > 0)
18282 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
18284 _res_constr.data = NULL;
18285 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
18286 for (size_t o = 0; o < _res_constr.datalen; o++) {
18287 int64_t _res_conv_14 = _res_vals[o];
18288 void* _res_conv_14_ptr = untag_ptr(_res_conv_14);
18289 CHECK_ACCESS(_res_conv_14_ptr);
18290 LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr);
18291 FREE(untag_ptr(_res_conv_14));
18292 _res_constr.data[o] = _res_conv_14_conv;
18294 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
18295 CVec_MonitorEventZ_free(_res_constr);
18298 static inline uint64_t C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg) {
18299 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
18300 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(arg);
18301 return tag_ptr(ret_conv, true);
18303 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18304 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* arg_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(arg);
18305 int64_t ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(arg_conv);
18309 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18310 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* orig_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(orig);
18311 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
18312 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(orig_conv);
18313 return tag_ptr(ret_conv, true);
18316 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) {
18317 LDKOutPoint a_conv;
18318 a_conv.inner = untag_ptr(a);
18319 a_conv.is_owned = ptr_is_owned(a);
18320 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
18321 a_conv = OutPoint_clone(&a_conv);
18322 LDKCVec_MonitorEventZ b_constr;
18323 b_constr.datalen = (*env)->GetArrayLength(env, b);
18324 if (b_constr.datalen > 0)
18325 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
18327 b_constr.data = NULL;
18328 int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
18329 for (size_t o = 0; o < b_constr.datalen; o++) {
18330 int64_t b_conv_14 = b_vals[o];
18331 void* b_conv_14_ptr = untag_ptr(b_conv_14);
18332 CHECK_ACCESS(b_conv_14_ptr);
18333 LDKMonitorEvent b_conv_14_conv = *(LDKMonitorEvent*)(b_conv_14_ptr);
18334 b_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(b_conv_14));
18335 b_constr.data[o] = b_conv_14_conv;
18337 (*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
18338 LDKPublicKey c_ref;
18339 CHECK((*env)->GetArrayLength(env, c) == 33);
18340 (*env)->GetByteArrayRegion(env, c, 0, 33, c_ref.compressed_form);
18341 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
18342 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(a_conv, b_constr, c_ref);
18343 return tag_ptr(ret_conv, true);
18346 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18347 if (!ptr_is_owned(_res)) return;
18348 void* _res_ptr = untag_ptr(_res);
18349 CHECK_ACCESS(_res_ptr);
18350 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_ptr);
18351 FREE(untag_ptr(_res));
18352 C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(_res_conv);
18355 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1OutPointCVec_1MonitorEventZPublicKeyZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
18356 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res_constr;
18357 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
18358 if (_res_constr.datalen > 0)
18359 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements");
18361 _res_constr.data = NULL;
18362 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
18363 for (size_t x = 0; x < _res_constr.datalen; x++) {
18364 int64_t _res_conv_49 = _res_vals[x];
18365 void* _res_conv_49_ptr = untag_ptr(_res_conv_49);
18366 CHECK_ACCESS(_res_conv_49_ptr);
18367 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_conv_49_ptr);
18368 FREE(untag_ptr(_res_conv_49));
18369 _res_constr.data[x] = _res_conv_49_conv;
18371 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
18372 CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(_res_constr);
18375 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18376 LDKFixedPenaltyScorer o_conv;
18377 o_conv.inner = untag_ptr(o);
18378 o_conv.is_owned = ptr_is_owned(o);
18379 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18380 o_conv = FixedPenaltyScorer_clone(&o_conv);
18381 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
18382 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_ok(o_conv);
18383 return tag_ptr(ret_conv, true);
18386 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18387 void* e_ptr = untag_ptr(e);
18388 CHECK_ACCESS(e_ptr);
18389 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18390 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18391 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
18392 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_err(e_conv);
18393 return tag_ptr(ret_conv, true);
18396 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18397 LDKCResult_FixedPenaltyScorerDecodeErrorZ* o_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(o);
18398 jboolean ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(o_conv);
18402 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18403 if (!ptr_is_owned(_res)) return;
18404 void* _res_ptr = untag_ptr(_res);
18405 CHECK_ACCESS(_res_ptr);
18406 LDKCResult_FixedPenaltyScorerDecodeErrorZ _res_conv = *(LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(_res_ptr);
18407 FREE(untag_ptr(_res));
18408 CResult_FixedPenaltyScorerDecodeErrorZ_free(_res_conv);
18411 static inline uint64_t CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR arg) {
18412 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
18413 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(arg);
18414 return tag_ptr(ret_conv, true);
18416 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18417 LDKCResult_FixedPenaltyScorerDecodeErrorZ* arg_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(arg);
18418 int64_t ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(arg_conv);
18422 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18423 LDKCResult_FixedPenaltyScorerDecodeErrorZ* orig_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(orig);
18424 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
18425 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(orig_conv);
18426 return tag_ptr(ret_conv, true);
18429 static inline uint64_t C2Tuple_u64u64Z_clone_ptr(LDKC2Tuple_u64u64Z *NONNULL_PTR arg) {
18430 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
18431 *ret_conv = C2Tuple_u64u64Z_clone(arg);
18432 return tag_ptr(ret_conv, true);
18434 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18435 LDKC2Tuple_u64u64Z* arg_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(arg);
18436 int64_t ret_conv = C2Tuple_u64u64Z_clone_ptr(arg_conv);
18440 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18441 LDKC2Tuple_u64u64Z* orig_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(orig);
18442 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
18443 *ret_conv = C2Tuple_u64u64Z_clone(orig_conv);
18444 return tag_ptr(ret_conv, true);
18447 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
18448 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
18449 *ret_conv = C2Tuple_u64u64Z_new(a, b);
18450 return tag_ptr(ret_conv, true);
18453 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
18454 if (!ptr_is_owned(_res)) return;
18455 void* _res_ptr = untag_ptr(_res);
18456 CHECK_ACCESS(_res_ptr);
18457 LDKC2Tuple_u64u64Z _res_conv = *(LDKC2Tuple_u64u64Z*)(_res_ptr);
18458 FREE(untag_ptr(_res));
18459 C2Tuple_u64u64Z_free(_res_conv);
18462 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1some(JNIEnv *env, jclass clz, int64_t o) {
18463 void* o_ptr = untag_ptr(o);
18464 CHECK_ACCESS(o_ptr);
18465 LDKC2Tuple_u64u64Z o_conv = *(LDKC2Tuple_u64u64Z*)(o_ptr);
18466 o_conv = C2Tuple_u64u64Z_clone((LDKC2Tuple_u64u64Z*)untag_ptr(o));
18467 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
18468 *ret_copy = COption_C2Tuple_u64u64ZZ_some(o_conv);
18469 int64_t ret_ref = tag_ptr(ret_copy, true);
18473 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1none(JNIEnv *env, jclass clz) {
18474 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
18475 *ret_copy = COption_C2Tuple_u64u64ZZ_none();
18476 int64_t ret_ref = tag_ptr(ret_copy, true);
18480 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18481 if (!ptr_is_owned(_res)) return;
18482 void* _res_ptr = untag_ptr(_res);
18483 CHECK_ACCESS(_res_ptr);
18484 LDKCOption_C2Tuple_u64u64ZZ _res_conv = *(LDKCOption_C2Tuple_u64u64ZZ*)(_res_ptr);
18485 FREE(untag_ptr(_res));
18486 COption_C2Tuple_u64u64ZZ_free(_res_conv);
18489 static inline uint64_t COption_C2Tuple_u64u64ZZ_clone_ptr(LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR arg) {
18490 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
18491 *ret_copy = COption_C2Tuple_u64u64ZZ_clone(arg);
18492 int64_t ret_ref = tag_ptr(ret_copy, true);
18495 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18496 LDKCOption_C2Tuple_u64u64ZZ* arg_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(arg);
18497 int64_t ret_conv = COption_C2Tuple_u64u64ZZ_clone_ptr(arg_conv);
18501 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1u64u64ZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18502 LDKCOption_C2Tuple_u64u64ZZ* orig_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(orig);
18503 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
18504 *ret_copy = COption_C2Tuple_u64u64ZZ_clone(orig_conv);
18505 int64_t ret_ref = tag_ptr(ret_copy, true);
18509 static inline uint64_t C2Tuple_Z_clone_ptr(LDKC2Tuple_Z *NONNULL_PTR arg) {
18510 LDKC2Tuple_Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_Z), "LDKC2Tuple_Z");
18511 *ret_conv = C2Tuple_Z_clone(arg);
18512 return tag_ptr(ret_conv, true);
18514 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18515 LDKC2Tuple_Z* arg_conv = (LDKC2Tuple_Z*)untag_ptr(arg);
18516 int64_t ret_conv = C2Tuple_Z_clone_ptr(arg_conv);
18520 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18521 LDKC2Tuple_Z* orig_conv = (LDKC2Tuple_Z*)untag_ptr(orig);
18522 LDKC2Tuple_Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_Z), "LDKC2Tuple_Z");
18523 *ret_conv = C2Tuple_Z_clone(orig_conv);
18524 return tag_ptr(ret_conv, true);
18527 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Z_1new(JNIEnv *env, jclass clz, int16_tArray a, int16_tArray b) {
18528 LDKEightU16s a_ref;
18529 CHECK((*env)->GetArrayLength(env, a) == 8);
18530 (*env)->GetShortArrayRegion(env, a, 0, 8, a_ref.data);
18531 LDKEightU16s b_ref;
18532 CHECK((*env)->GetArrayLength(env, b) == 8);
18533 (*env)->GetShortArrayRegion(env, b, 0, 8, b_ref.data);
18534 LDKC2Tuple_Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_Z), "LDKC2Tuple_Z");
18535 *ret_conv = C2Tuple_Z_new(a_ref, b_ref);
18536 return tag_ptr(ret_conv, true);
18539 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
18540 if (!ptr_is_owned(_res)) return;
18541 void* _res_ptr = untag_ptr(_res);
18542 CHECK_ACCESS(_res_ptr);
18543 LDKC2Tuple_Z _res_conv = *(LDKC2Tuple_Z*)(_res_ptr);
18544 FREE(untag_ptr(_res));
18545 C2Tuple_Z_free(_res_conv);
18548 static inline uint64_t C2Tuple__u168_u168Z_clone_ptr(LDKC2Tuple__u168_u168Z *NONNULL_PTR arg) {
18549 LDKC2Tuple__u168_u168Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u168_u168Z), "LDKC2Tuple__u168_u168Z");
18550 *ret_conv = C2Tuple__u168_u168Z_clone(arg);
18551 return tag_ptr(ret_conv, true);
18553 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u168_1u168Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18554 LDKC2Tuple__u168_u168Z* arg_conv = (LDKC2Tuple__u168_u168Z*)untag_ptr(arg);
18555 int64_t ret_conv = C2Tuple__u168_u168Z_clone_ptr(arg_conv);
18559 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u168_1u168Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18560 LDKC2Tuple__u168_u168Z* orig_conv = (LDKC2Tuple__u168_u168Z*)untag_ptr(orig);
18561 LDKC2Tuple__u168_u168Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u168_u168Z), "LDKC2Tuple__u168_u168Z");
18562 *ret_conv = C2Tuple__u168_u168Z_clone(orig_conv);
18563 return tag_ptr(ret_conv, true);
18566 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u168_1u168Z_1new(JNIEnv *env, jclass clz, int16_tArray a, int16_tArray b) {
18567 LDKEightU16s a_ref;
18568 CHECK((*env)->GetArrayLength(env, a) == 8);
18569 (*env)->GetShortArrayRegion(env, a, 0, 8, a_ref.data);
18570 LDKEightU16s b_ref;
18571 CHECK((*env)->GetArrayLength(env, b) == 8);
18572 (*env)->GetShortArrayRegion(env, b, 0, 8, b_ref.data);
18573 LDKC2Tuple__u168_u168Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u168_u168Z), "LDKC2Tuple__u168_u168Z");
18574 *ret_conv = C2Tuple__u168_u168Z_new(a_ref, b_ref);
18575 return tag_ptr(ret_conv, true);
18578 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1_1u168_1u168Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
18579 if (!ptr_is_owned(_res)) return;
18580 void* _res_ptr = untag_ptr(_res);
18581 CHECK_ACCESS(_res_ptr);
18582 LDKC2Tuple__u168_u168Z _res_conv = *(LDKC2Tuple__u168_u168Z*)(_res_ptr);
18583 FREE(untag_ptr(_res));
18584 C2Tuple__u168_u168Z_free(_res_conv);
18587 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1EightU16sEightU16sZZ_1some(JNIEnv *env, jclass clz, int64_t o) {
18588 void* o_ptr = untag_ptr(o);
18589 CHECK_ACCESS(o_ptr);
18590 LDKC2Tuple__u168_u168Z o_conv = *(LDKC2Tuple__u168_u168Z*)(o_ptr);
18591 o_conv = C2Tuple__u168_u168Z_clone((LDKC2Tuple__u168_u168Z*)untag_ptr(o));
18592 LDKCOption_C2Tuple_EightU16sEightU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_EightU16sEightU16sZZ), "LDKCOption_C2Tuple_EightU16sEightU16sZZ");
18593 *ret_copy = COption_C2Tuple_EightU16sEightU16sZZ_some(o_conv);
18594 int64_t ret_ref = tag_ptr(ret_copy, true);
18598 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1EightU16sEightU16sZZ_1none(JNIEnv *env, jclass clz) {
18599 LDKCOption_C2Tuple_EightU16sEightU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_EightU16sEightU16sZZ), "LDKCOption_C2Tuple_EightU16sEightU16sZZ");
18600 *ret_copy = COption_C2Tuple_EightU16sEightU16sZZ_none();
18601 int64_t ret_ref = tag_ptr(ret_copy, true);
18605 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1EightU16sEightU16sZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18606 if (!ptr_is_owned(_res)) return;
18607 void* _res_ptr = untag_ptr(_res);
18608 CHECK_ACCESS(_res_ptr);
18609 LDKCOption_C2Tuple_EightU16sEightU16sZZ _res_conv = *(LDKCOption_C2Tuple_EightU16sEightU16sZZ*)(_res_ptr);
18610 FREE(untag_ptr(_res));
18611 COption_C2Tuple_EightU16sEightU16sZZ_free(_res_conv);
18614 static inline uint64_t COption_C2Tuple_EightU16sEightU16sZZ_clone_ptr(LDKCOption_C2Tuple_EightU16sEightU16sZZ *NONNULL_PTR arg) {
18615 LDKCOption_C2Tuple_EightU16sEightU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_EightU16sEightU16sZZ), "LDKCOption_C2Tuple_EightU16sEightU16sZZ");
18616 *ret_copy = COption_C2Tuple_EightU16sEightU16sZZ_clone(arg);
18617 int64_t ret_ref = tag_ptr(ret_copy, true);
18620 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1EightU16sEightU16sZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18621 LDKCOption_C2Tuple_EightU16sEightU16sZZ* arg_conv = (LDKCOption_C2Tuple_EightU16sEightU16sZZ*)untag_ptr(arg);
18622 int64_t ret_conv = COption_C2Tuple_EightU16sEightU16sZZ_clone_ptr(arg_conv);
18626 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C2Tuple_1EightU16sEightU16sZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18627 LDKCOption_C2Tuple_EightU16sEightU16sZZ* orig_conv = (LDKCOption_C2Tuple_EightU16sEightU16sZZ*)untag_ptr(orig);
18628 LDKCOption_C2Tuple_EightU16sEightU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_EightU16sEightU16sZZ), "LDKCOption_C2Tuple_EightU16sEightU16sZZ");
18629 *ret_copy = COption_C2Tuple_EightU16sEightU16sZZ_clone(orig_conv);
18630 int64_t ret_ref = tag_ptr(ret_copy, true);
18634 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeIdZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
18635 LDKCVec_NodeIdZ _res_constr;
18636 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
18637 if (_res_constr.datalen > 0)
18638 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements");
18640 _res_constr.data = NULL;
18641 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
18642 for (size_t i = 0; i < _res_constr.datalen; i++) {
18643 int64_t _res_conv_8 = _res_vals[i];
18644 LDKNodeId _res_conv_8_conv;
18645 _res_conv_8_conv.inner = untag_ptr(_res_conv_8);
18646 _res_conv_8_conv.is_owned = ptr_is_owned(_res_conv_8);
18647 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_8_conv);
18648 _res_constr.data[i] = _res_conv_8_conv;
18650 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
18651 CVec_NodeIdZ_free(_res_constr);
18654 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18655 LDKProbabilisticScorer o_conv;
18656 o_conv.inner = untag_ptr(o);
18657 o_conv.is_owned = ptr_is_owned(o);
18658 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18659 // WARNING: we need a move here but no clone is available for LDKProbabilisticScorer
18661 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
18662 *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_ok(o_conv);
18663 return tag_ptr(ret_conv, true);
18666 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18667 void* e_ptr = untag_ptr(e);
18668 CHECK_ACCESS(e_ptr);
18669 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18670 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18671 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
18672 *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_err(e_conv);
18673 return tag_ptr(ret_conv, true);
18676 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18677 LDKCResult_ProbabilisticScorerDecodeErrorZ* o_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(o);
18678 jboolean ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_is_ok(o_conv);
18682 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18683 if (!ptr_is_owned(_res)) return;
18684 void* _res_ptr = untag_ptr(_res);
18685 CHECK_ACCESS(_res_ptr);
18686 LDKCResult_ProbabilisticScorerDecodeErrorZ _res_conv = *(LDKCResult_ProbabilisticScorerDecodeErrorZ*)(_res_ptr);
18687 FREE(untag_ptr(_res));
18688 CResult_ProbabilisticScorerDecodeErrorZ_free(_res_conv);
18691 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18692 LDKInitFeatures o_conv;
18693 o_conv.inner = untag_ptr(o);
18694 o_conv.is_owned = ptr_is_owned(o);
18695 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18696 o_conv = InitFeatures_clone(&o_conv);
18697 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
18698 *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv);
18699 return tag_ptr(ret_conv, true);
18702 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18703 void* e_ptr = untag_ptr(e);
18704 CHECK_ACCESS(e_ptr);
18705 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18706 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18707 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
18708 *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
18709 return tag_ptr(ret_conv, true);
18712 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18713 LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(o);
18714 jboolean ret_conv = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv);
18718 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18719 if (!ptr_is_owned(_res)) return;
18720 void* _res_ptr = untag_ptr(_res);
18721 CHECK_ACCESS(_res_ptr);
18722 LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
18723 FREE(untag_ptr(_res));
18724 CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
18727 static inline uint64_t CResult_InitFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR arg) {
18728 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
18729 *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(arg);
18730 return tag_ptr(ret_conv, true);
18732 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18733 LDKCResult_InitFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(arg);
18734 int64_t ret_conv = CResult_InitFeaturesDecodeErrorZ_clone_ptr(arg_conv);
18738 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18739 LDKCResult_InitFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(orig);
18740 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
18741 *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(orig_conv);
18742 return tag_ptr(ret_conv, true);
18745 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18746 LDKChannelFeatures o_conv;
18747 o_conv.inner = untag_ptr(o);
18748 o_conv.is_owned = ptr_is_owned(o);
18749 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18750 o_conv = ChannelFeatures_clone(&o_conv);
18751 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
18752 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv);
18753 return tag_ptr(ret_conv, true);
18756 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18757 void* e_ptr = untag_ptr(e);
18758 CHECK_ACCESS(e_ptr);
18759 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18760 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18761 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
18762 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv);
18763 return tag_ptr(ret_conv, true);
18766 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18767 LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(o);
18768 jboolean ret_conv = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv);
18772 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18773 if (!ptr_is_owned(_res)) return;
18774 void* _res_ptr = untag_ptr(_res);
18775 CHECK_ACCESS(_res_ptr);
18776 LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr);
18777 FREE(untag_ptr(_res));
18778 CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
18781 static inline uint64_t CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR arg) {
18782 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
18783 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(arg);
18784 return tag_ptr(ret_conv, true);
18786 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18787 LDKCResult_ChannelFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(arg);
18788 int64_t ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(arg_conv);
18792 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18793 LDKCResult_ChannelFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(orig);
18794 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
18795 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(orig_conv);
18796 return tag_ptr(ret_conv, true);
18799 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18800 LDKNodeFeatures o_conv;
18801 o_conv.inner = untag_ptr(o);
18802 o_conv.is_owned = ptr_is_owned(o);
18803 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18804 o_conv = NodeFeatures_clone(&o_conv);
18805 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
18806 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv);
18807 return tag_ptr(ret_conv, true);
18810 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18811 void* e_ptr = untag_ptr(e);
18812 CHECK_ACCESS(e_ptr);
18813 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18814 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18815 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
18816 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
18817 return tag_ptr(ret_conv, true);
18820 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18821 LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(o);
18822 jboolean ret_conv = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv);
18826 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18827 if (!ptr_is_owned(_res)) return;
18828 void* _res_ptr = untag_ptr(_res);
18829 CHECK_ACCESS(_res_ptr);
18830 LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
18831 FREE(untag_ptr(_res));
18832 CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
18835 static inline uint64_t CResult_NodeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR arg) {
18836 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
18837 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(arg);
18838 return tag_ptr(ret_conv, true);
18840 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18841 LDKCResult_NodeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(arg);
18842 int64_t ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone_ptr(arg_conv);
18846 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18847 LDKCResult_NodeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(orig);
18848 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
18849 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(orig_conv);
18850 return tag_ptr(ret_conv, true);
18853 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18854 LDKInvoiceFeatures o_conv;
18855 o_conv.inner = untag_ptr(o);
18856 o_conv.is_owned = ptr_is_owned(o);
18857 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18858 o_conv = InvoiceFeatures_clone(&o_conv);
18859 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
18860 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
18861 return tag_ptr(ret_conv, true);
18864 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18865 void* e_ptr = untag_ptr(e);
18866 CHECK_ACCESS(e_ptr);
18867 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18868 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18869 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
18870 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
18871 return tag_ptr(ret_conv, true);
18874 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18875 LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(o);
18876 jboolean ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv);
18880 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18881 if (!ptr_is_owned(_res)) return;
18882 void* _res_ptr = untag_ptr(_res);
18883 CHECK_ACCESS(_res_ptr);
18884 LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
18885 FREE(untag_ptr(_res));
18886 CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
18889 static inline uint64_t CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) {
18890 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
18891 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(arg);
18892 return tag_ptr(ret_conv, true);
18894 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18895 LDKCResult_InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(arg);
18896 int64_t ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv);
18900 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18901 LDKCResult_InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(orig);
18902 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
18903 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(orig_conv);
18904 return tag_ptr(ret_conv, true);
18907 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18908 LDKBlindedHopFeatures o_conv;
18909 o_conv.inner = untag_ptr(o);
18910 o_conv.is_owned = ptr_is_owned(o);
18911 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18912 o_conv = BlindedHopFeatures_clone(&o_conv);
18913 LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ");
18914 *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_ok(o_conv);
18915 return tag_ptr(ret_conv, true);
18918 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18919 void* e_ptr = untag_ptr(e);
18920 CHECK_ACCESS(e_ptr);
18921 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18922 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18923 LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ");
18924 *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_err(e_conv);
18925 return tag_ptr(ret_conv, true);
18928 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18929 LDKCResult_BlindedHopFeaturesDecodeErrorZ* o_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(o);
18930 jboolean ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(o_conv);
18934 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18935 if (!ptr_is_owned(_res)) return;
18936 void* _res_ptr = untag_ptr(_res);
18937 CHECK_ACCESS(_res_ptr);
18938 LDKCResult_BlindedHopFeaturesDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopFeaturesDecodeErrorZ*)(_res_ptr);
18939 FREE(untag_ptr(_res));
18940 CResult_BlindedHopFeaturesDecodeErrorZ_free(_res_conv);
18943 static inline uint64_t CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR arg) {
18944 LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ");
18945 *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone(arg);
18946 return tag_ptr(ret_conv, true);
18948 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
18949 LDKCResult_BlindedHopFeaturesDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(arg);
18950 int64_t ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone_ptr(arg_conv);
18954 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
18955 LDKCResult_BlindedHopFeaturesDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopFeaturesDecodeErrorZ*)untag_ptr(orig);
18956 LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ");
18957 *ret_conv = CResult_BlindedHopFeaturesDecodeErrorZ_clone(orig_conv);
18958 return tag_ptr(ret_conv, true);
18961 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
18962 LDKChannelTypeFeatures o_conv;
18963 o_conv.inner = untag_ptr(o);
18964 o_conv.is_owned = ptr_is_owned(o);
18965 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18966 o_conv = ChannelTypeFeatures_clone(&o_conv);
18967 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
18968 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv);
18969 return tag_ptr(ret_conv, true);
18972 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
18973 void* e_ptr = untag_ptr(e);
18974 CHECK_ACCESS(e_ptr);
18975 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
18976 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
18977 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
18978 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv);
18979 return tag_ptr(ret_conv, true);
18982 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
18983 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(o);
18984 jboolean ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o_conv);
18988 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
18989 if (!ptr_is_owned(_res)) return;
18990 void* _res_ptr = untag_ptr(_res);
18991 CHECK_ACCESS(_res_ptr);
18992 LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr);
18993 FREE(untag_ptr(_res));
18994 CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv);
18997 static inline uint64_t CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR arg) {
18998 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
18999 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(arg);
19000 return tag_ptr(ret_conv, true);
19002 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19003 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(arg);
19004 int64_t ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(arg_conv);
19008 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19009 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(orig);
19010 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
19011 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(orig_conv);
19012 return tag_ptr(ret_conv, true);
19015 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19016 void* o_ptr = untag_ptr(o);
19017 CHECK_ACCESS(o_ptr);
19018 LDKPaymentPurpose o_conv = *(LDKPaymentPurpose*)(o_ptr);
19019 o_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(o));
19020 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
19021 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_ok(o_conv);
19022 return tag_ptr(ret_conv, true);
19025 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19026 void* e_ptr = untag_ptr(e);
19027 CHECK_ACCESS(e_ptr);
19028 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19029 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19030 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
19031 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv);
19032 return tag_ptr(ret_conv, true);
19035 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19036 LDKCResult_PaymentPurposeDecodeErrorZ* o_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(o);
19037 jboolean ret_conv = CResult_PaymentPurposeDecodeErrorZ_is_ok(o_conv);
19041 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19042 if (!ptr_is_owned(_res)) return;
19043 void* _res_ptr = untag_ptr(_res);
19044 CHECK_ACCESS(_res_ptr);
19045 LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr);
19046 FREE(untag_ptr(_res));
19047 CResult_PaymentPurposeDecodeErrorZ_free(_res_conv);
19050 static inline uint64_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg) {
19051 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
19052 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(arg);
19053 return tag_ptr(ret_conv, true);
19055 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19056 LDKCResult_PaymentPurposeDecodeErrorZ* arg_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(arg);
19057 int64_t ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone_ptr(arg_conv);
19061 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19062 LDKCResult_PaymentPurposeDecodeErrorZ* orig_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(orig);
19063 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
19064 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(orig_conv);
19065 return tag_ptr(ret_conv, true);
19068 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1some(JNIEnv *env, jclass clz, int64_t o) {
19069 void* o_ptr = untag_ptr(o);
19070 CHECK_ACCESS(o_ptr);
19071 LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(o_ptr);
19072 o_conv = NetworkUpdate_clone((LDKNetworkUpdate*)untag_ptr(o));
19073 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
19074 *ret_copy = COption_NetworkUpdateZ_some(o_conv);
19075 int64_t ret_ref = tag_ptr(ret_copy, true);
19079 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1none(JNIEnv *env, jclass clz) {
19080 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
19081 *ret_copy = COption_NetworkUpdateZ_none();
19082 int64_t ret_ref = tag_ptr(ret_copy, true);
19086 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19087 if (!ptr_is_owned(_res)) return;
19088 void* _res_ptr = untag_ptr(_res);
19089 CHECK_ACCESS(_res_ptr);
19090 LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(_res_ptr);
19091 FREE(untag_ptr(_res));
19092 COption_NetworkUpdateZ_free(_res_conv);
19095 static inline uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg) {
19096 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
19097 *ret_copy = COption_NetworkUpdateZ_clone(arg);
19098 int64_t ret_ref = tag_ptr(ret_copy, true);
19101 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19102 LDKCOption_NetworkUpdateZ* arg_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(arg);
19103 int64_t ret_conv = COption_NetworkUpdateZ_clone_ptr(arg_conv);
19107 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19108 LDKCOption_NetworkUpdateZ* orig_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(orig);
19109 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
19110 *ret_copy = COption_NetworkUpdateZ_clone(orig_conv);
19111 int64_t ret_ref = tag_ptr(ret_copy, true);
19115 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PathFailureZ_1some(JNIEnv *env, jclass clz, int64_t o) {
19116 void* o_ptr = untag_ptr(o);
19117 CHECK_ACCESS(o_ptr);
19118 LDKPathFailure o_conv = *(LDKPathFailure*)(o_ptr);
19119 o_conv = PathFailure_clone((LDKPathFailure*)untag_ptr(o));
19120 LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ");
19121 *ret_copy = COption_PathFailureZ_some(o_conv);
19122 int64_t ret_ref = tag_ptr(ret_copy, true);
19126 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PathFailureZ_1none(JNIEnv *env, jclass clz) {
19127 LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ");
19128 *ret_copy = COption_PathFailureZ_none();
19129 int64_t ret_ref = tag_ptr(ret_copy, true);
19133 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1PathFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19134 if (!ptr_is_owned(_res)) return;
19135 void* _res_ptr = untag_ptr(_res);
19136 CHECK_ACCESS(_res_ptr);
19137 LDKCOption_PathFailureZ _res_conv = *(LDKCOption_PathFailureZ*)(_res_ptr);
19138 FREE(untag_ptr(_res));
19139 COption_PathFailureZ_free(_res_conv);
19142 static inline uint64_t COption_PathFailureZ_clone_ptr(LDKCOption_PathFailureZ *NONNULL_PTR arg) {
19143 LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ");
19144 *ret_copy = COption_PathFailureZ_clone(arg);
19145 int64_t ret_ref = tag_ptr(ret_copy, true);
19148 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PathFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19149 LDKCOption_PathFailureZ* arg_conv = (LDKCOption_PathFailureZ*)untag_ptr(arg);
19150 int64_t ret_conv = COption_PathFailureZ_clone_ptr(arg_conv);
19154 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PathFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19155 LDKCOption_PathFailureZ* orig_conv = (LDKCOption_PathFailureZ*)untag_ptr(orig);
19156 LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ");
19157 *ret_copy = COption_PathFailureZ_clone(orig_conv);
19158 int64_t ret_ref = tag_ptr(ret_copy, true);
19162 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PathFailureZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19163 void* o_ptr = untag_ptr(o);
19164 CHECK_ACCESS(o_ptr);
19165 LDKCOption_PathFailureZ o_conv = *(LDKCOption_PathFailureZ*)(o_ptr);
19166 o_conv = COption_PathFailureZ_clone((LDKCOption_PathFailureZ*)untag_ptr(o));
19167 LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ");
19168 *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_ok(o_conv);
19169 return tag_ptr(ret_conv, true);
19172 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PathFailureZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19173 void* e_ptr = untag_ptr(e);
19174 CHECK_ACCESS(e_ptr);
19175 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19176 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19177 LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ");
19178 *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_err(e_conv);
19179 return tag_ptr(ret_conv, true);
19182 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PathFailureZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19183 LDKCResult_COption_PathFailureZDecodeErrorZ* o_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(o);
19184 jboolean ret_conv = CResult_COption_PathFailureZDecodeErrorZ_is_ok(o_conv);
19188 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PathFailureZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19189 if (!ptr_is_owned(_res)) return;
19190 void* _res_ptr = untag_ptr(_res);
19191 CHECK_ACCESS(_res_ptr);
19192 LDKCResult_COption_PathFailureZDecodeErrorZ _res_conv = *(LDKCResult_COption_PathFailureZDecodeErrorZ*)(_res_ptr);
19193 FREE(untag_ptr(_res));
19194 CResult_COption_PathFailureZDecodeErrorZ_free(_res_conv);
19197 static inline uint64_t CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR arg) {
19198 LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ");
19199 *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone(arg);
19200 return tag_ptr(ret_conv, true);
19202 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PathFailureZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19203 LDKCResult_COption_PathFailureZDecodeErrorZ* arg_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(arg);
19204 int64_t ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(arg_conv);
19208 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1PathFailureZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19209 LDKCResult_COption_PathFailureZDecodeErrorZ* orig_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(orig);
19210 LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ");
19211 *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone(orig_conv);
19212 return tag_ptr(ret_conv, true);
19215 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1some(JNIEnv *env, jclass clz, int64_t o) {
19216 void* o_ptr = untag_ptr(o);
19217 CHECK_ACCESS(o_ptr);
19218 LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr);
19219 o_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(o));
19220 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
19221 *ret_copy = COption_ClosureReasonZ_some(o_conv);
19222 int64_t ret_ref = tag_ptr(ret_copy, true);
19226 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1none(JNIEnv *env, jclass clz) {
19227 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
19228 *ret_copy = COption_ClosureReasonZ_none();
19229 int64_t ret_ref = tag_ptr(ret_copy, true);
19233 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19234 if (!ptr_is_owned(_res)) return;
19235 void* _res_ptr = untag_ptr(_res);
19236 CHECK_ACCESS(_res_ptr);
19237 LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr);
19238 FREE(untag_ptr(_res));
19239 COption_ClosureReasonZ_free(_res_conv);
19242 static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) {
19243 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
19244 *ret_copy = COption_ClosureReasonZ_clone(arg);
19245 int64_t ret_ref = tag_ptr(ret_copy, true);
19248 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19249 LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(arg);
19250 int64_t ret_conv = COption_ClosureReasonZ_clone_ptr(arg_conv);
19254 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ClosureReasonZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19255 LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(orig);
19256 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
19257 *ret_copy = COption_ClosureReasonZ_clone(orig_conv);
19258 int64_t ret_ref = tag_ptr(ret_copy, true);
19262 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19263 void* o_ptr = untag_ptr(o);
19264 CHECK_ACCESS(o_ptr);
19265 LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr);
19266 o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)untag_ptr(o));
19267 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
19268 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv);
19269 return tag_ptr(ret_conv, true);
19272 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19273 void* e_ptr = untag_ptr(e);
19274 CHECK_ACCESS(e_ptr);
19275 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19276 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19277 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
19278 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv);
19279 return tag_ptr(ret_conv, true);
19282 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19283 LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(o);
19284 jboolean ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv);
19288 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19289 if (!ptr_is_owned(_res)) return;
19290 void* _res_ptr = untag_ptr(_res);
19291 CHECK_ACCESS(_res_ptr);
19292 LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr);
19293 FREE(untag_ptr(_res));
19294 CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv);
19297 static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) {
19298 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
19299 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg);
19300 return tag_ptr(ret_conv, true);
19302 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19303 LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(arg);
19304 int64_t ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv);
19308 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19309 LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(orig);
19310 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
19311 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv);
19312 return tag_ptr(ret_conv, true);
19315 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1some(JNIEnv *env, jclass clz, int64_t o) {
19316 void* o_ptr = untag_ptr(o);
19317 CHECK_ACCESS(o_ptr);
19318 LDKHTLCDestination o_conv = *(LDKHTLCDestination*)(o_ptr);
19319 o_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(o));
19320 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
19321 *ret_copy = COption_HTLCDestinationZ_some(o_conv);
19322 int64_t ret_ref = tag_ptr(ret_copy, true);
19326 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1none(JNIEnv *env, jclass clz) {
19327 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
19328 *ret_copy = COption_HTLCDestinationZ_none();
19329 int64_t ret_ref = tag_ptr(ret_copy, true);
19333 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19334 if (!ptr_is_owned(_res)) return;
19335 void* _res_ptr = untag_ptr(_res);
19336 CHECK_ACCESS(_res_ptr);
19337 LDKCOption_HTLCDestinationZ _res_conv = *(LDKCOption_HTLCDestinationZ*)(_res_ptr);
19338 FREE(untag_ptr(_res));
19339 COption_HTLCDestinationZ_free(_res_conv);
19342 static inline uint64_t COption_HTLCDestinationZ_clone_ptr(LDKCOption_HTLCDestinationZ *NONNULL_PTR arg) {
19343 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
19344 *ret_copy = COption_HTLCDestinationZ_clone(arg);
19345 int64_t ret_ref = tag_ptr(ret_copy, true);
19348 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19349 LDKCOption_HTLCDestinationZ* arg_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(arg);
19350 int64_t ret_conv = COption_HTLCDestinationZ_clone_ptr(arg_conv);
19354 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCDestinationZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19355 LDKCOption_HTLCDestinationZ* orig_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(orig);
19356 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
19357 *ret_copy = COption_HTLCDestinationZ_clone(orig_conv);
19358 int64_t ret_ref = tag_ptr(ret_copy, true);
19362 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19363 void* o_ptr = untag_ptr(o);
19364 CHECK_ACCESS(o_ptr);
19365 LDKCOption_HTLCDestinationZ o_conv = *(LDKCOption_HTLCDestinationZ*)(o_ptr);
19366 o_conv = COption_HTLCDestinationZ_clone((LDKCOption_HTLCDestinationZ*)untag_ptr(o));
19367 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
19368 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_ok(o_conv);
19369 return tag_ptr(ret_conv, true);
19372 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19373 void* e_ptr = untag_ptr(e);
19374 CHECK_ACCESS(e_ptr);
19375 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19376 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19377 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
19378 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_err(e_conv);
19379 return tag_ptr(ret_conv, true);
19382 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19383 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* o_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(o);
19384 jboolean ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(o_conv);
19388 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19389 if (!ptr_is_owned(_res)) return;
19390 void* _res_ptr = untag_ptr(_res);
19391 CHECK_ACCESS(_res_ptr);
19392 LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res_conv = *(LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)(_res_ptr);
19393 FREE(untag_ptr(_res));
19394 CResult_COption_HTLCDestinationZDecodeErrorZ_free(_res_conv);
19397 static inline uint64_t CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR arg) {
19398 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
19399 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(arg);
19400 return tag_ptr(ret_conv, true);
19402 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19403 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* arg_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(arg);
19404 int64_t ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(arg_conv);
19408 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19409 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* orig_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(orig);
19410 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
19411 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(orig_conv);
19412 return tag_ptr(ret_conv, true);
19415 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1ok(JNIEnv *env, jclass clz, jclass o) {
19416 LDKPaymentFailureReason o_conv = LDKPaymentFailureReason_from_java(env, o);
19417 LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ");
19418 *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_ok(o_conv);
19419 return tag_ptr(ret_conv, true);
19422 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19423 void* e_ptr = untag_ptr(e);
19424 CHECK_ACCESS(e_ptr);
19425 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19426 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19427 LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ");
19428 *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_err(e_conv);
19429 return tag_ptr(ret_conv, true);
19432 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19433 LDKCResult_PaymentFailureReasonDecodeErrorZ* o_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(o);
19434 jboolean ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_is_ok(o_conv);
19438 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19439 if (!ptr_is_owned(_res)) return;
19440 void* _res_ptr = untag_ptr(_res);
19441 CHECK_ACCESS(_res_ptr);
19442 LDKCResult_PaymentFailureReasonDecodeErrorZ _res_conv = *(LDKCResult_PaymentFailureReasonDecodeErrorZ*)(_res_ptr);
19443 FREE(untag_ptr(_res));
19444 CResult_PaymentFailureReasonDecodeErrorZ_free(_res_conv);
19447 static inline uint64_t CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR arg) {
19448 LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ");
19449 *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone(arg);
19450 return tag_ptr(ret_conv, true);
19452 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19453 LDKCResult_PaymentFailureReasonDecodeErrorZ* arg_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(arg);
19454 int64_t ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone_ptr(arg_conv);
19458 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentFailureReasonDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19459 LDKCResult_PaymentFailureReasonDecodeErrorZ* orig_conv = (LDKCResult_PaymentFailureReasonDecodeErrorZ*)untag_ptr(orig);
19460 LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ");
19461 *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_clone(orig_conv);
19462 return tag_ptr(ret_conv, true);
19465 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1some(JNIEnv *env, jclass clz, int8_tArray o) {
19467 CHECK((*env)->GetArrayLength(env, o) == 16);
19468 (*env)->GetByteArrayRegion(env, o, 0, 16, o_ref.le_bytes);
19469 LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z");
19470 *ret_copy = COption_u128Z_some(o_ref);
19471 int64_t ret_ref = tag_ptr(ret_copy, true);
19475 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1none(JNIEnv *env, jclass clz) {
19476 LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z");
19477 *ret_copy = COption_u128Z_none();
19478 int64_t ret_ref = tag_ptr(ret_copy, true);
19482 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
19483 if (!ptr_is_owned(_res)) return;
19484 void* _res_ptr = untag_ptr(_res);
19485 CHECK_ACCESS(_res_ptr);
19486 LDKCOption_u128Z _res_conv = *(LDKCOption_u128Z*)(_res_ptr);
19487 FREE(untag_ptr(_res));
19488 COption_u128Z_free(_res_conv);
19491 static inline uint64_t COption_u128Z_clone_ptr(LDKCOption_u128Z *NONNULL_PTR arg) {
19492 LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z");
19493 *ret_copy = COption_u128Z_clone(arg);
19494 int64_t ret_ref = tag_ptr(ret_copy, true);
19497 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19498 LDKCOption_u128Z* arg_conv = (LDKCOption_u128Z*)untag_ptr(arg);
19499 int64_t ret_conv = COption_u128Z_clone_ptr(arg_conv);
19503 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19504 LDKCOption_u128Z* orig_conv = (LDKCOption_u128Z*)untag_ptr(orig);
19505 LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z");
19506 *ret_copy = COption_u128Z_clone(orig_conv);
19507 int64_t ret_ref = tag_ptr(ret_copy, true);
19511 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1some(JNIEnv *env, jclass clz, jclass o) {
19512 LDKPaymentFailureReason o_conv = LDKPaymentFailureReason_from_java(env, o);
19513 LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ");
19514 *ret_copy = COption_PaymentFailureReasonZ_some(o_conv);
19515 int64_t ret_ref = tag_ptr(ret_copy, true);
19519 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1none(JNIEnv *env, jclass clz) {
19520 LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ");
19521 *ret_copy = COption_PaymentFailureReasonZ_none();
19522 int64_t ret_ref = tag_ptr(ret_copy, true);
19526 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19527 if (!ptr_is_owned(_res)) return;
19528 void* _res_ptr = untag_ptr(_res);
19529 CHECK_ACCESS(_res_ptr);
19530 LDKCOption_PaymentFailureReasonZ _res_conv = *(LDKCOption_PaymentFailureReasonZ*)(_res_ptr);
19531 FREE(untag_ptr(_res));
19532 COption_PaymentFailureReasonZ_free(_res_conv);
19535 static inline uint64_t COption_PaymentFailureReasonZ_clone_ptr(LDKCOption_PaymentFailureReasonZ *NONNULL_PTR arg) {
19536 LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ");
19537 *ret_copy = COption_PaymentFailureReasonZ_clone(arg);
19538 int64_t ret_ref = tag_ptr(ret_copy, true);
19541 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19542 LDKCOption_PaymentFailureReasonZ* arg_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(arg);
19543 int64_t ret_conv = COption_PaymentFailureReasonZ_clone_ptr(arg_conv);
19547 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1PaymentFailureReasonZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19548 LDKCOption_PaymentFailureReasonZ* orig_conv = (LDKCOption_PaymentFailureReasonZ*)untag_ptr(orig);
19549 LDKCOption_PaymentFailureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentFailureReasonZ), "LDKCOption_PaymentFailureReasonZ");
19550 *ret_copy = COption_PaymentFailureReasonZ_clone(orig_conv);
19551 int64_t ret_ref = tag_ptr(ret_copy, true);
19555 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
19556 LDKCVec_SpendableOutputDescriptorZ _res_constr;
19557 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
19558 if (_res_constr.datalen > 0)
19559 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
19561 _res_constr.data = NULL;
19562 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
19563 for (size_t b = 0; b < _res_constr.datalen; b++) {
19564 int64_t _res_conv_27 = _res_vals[b];
19565 void* _res_conv_27_ptr = untag_ptr(_res_conv_27);
19566 CHECK_ACCESS(_res_conv_27_ptr);
19567 LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(_res_conv_27_ptr);
19568 FREE(untag_ptr(_res_conv_27));
19569 _res_constr.data[b] = _res_conv_27_conv;
19571 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
19572 CVec_SpendableOutputDescriptorZ_free(_res_constr);
19575 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1some(JNIEnv *env, jclass clz, int64_t o) {
19576 void* o_ptr = untag_ptr(o);
19577 CHECK_ACCESS(o_ptr);
19578 LDKEvent o_conv = *(LDKEvent*)(o_ptr);
19579 o_conv = Event_clone((LDKEvent*)untag_ptr(o));
19580 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
19581 *ret_copy = COption_EventZ_some(o_conv);
19582 int64_t ret_ref = tag_ptr(ret_copy, true);
19586 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1none(JNIEnv *env, jclass clz) {
19587 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
19588 *ret_copy = COption_EventZ_none();
19589 int64_t ret_ref = tag_ptr(ret_copy, true);
19593 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19594 if (!ptr_is_owned(_res)) return;
19595 void* _res_ptr = untag_ptr(_res);
19596 CHECK_ACCESS(_res_ptr);
19597 LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr);
19598 FREE(untag_ptr(_res));
19599 COption_EventZ_free(_res_conv);
19602 static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) {
19603 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
19604 *ret_copy = COption_EventZ_clone(arg);
19605 int64_t ret_ref = tag_ptr(ret_copy, true);
19608 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19609 LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)untag_ptr(arg);
19610 int64_t ret_conv = COption_EventZ_clone_ptr(arg_conv);
19614 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19615 LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)untag_ptr(orig);
19616 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
19617 *ret_copy = COption_EventZ_clone(orig_conv);
19618 int64_t ret_ref = tag_ptr(ret_copy, true);
19622 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19623 void* o_ptr = untag_ptr(o);
19624 CHECK_ACCESS(o_ptr);
19625 LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr);
19626 o_conv = COption_EventZ_clone((LDKCOption_EventZ*)untag_ptr(o));
19627 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
19628 *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv);
19629 return tag_ptr(ret_conv, true);
19632 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19633 void* e_ptr = untag_ptr(e);
19634 CHECK_ACCESS(e_ptr);
19635 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19636 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19637 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
19638 *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv);
19639 return tag_ptr(ret_conv, true);
19642 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19643 LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(o);
19644 jboolean ret_conv = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv);
19648 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19649 if (!ptr_is_owned(_res)) return;
19650 void* _res_ptr = untag_ptr(_res);
19651 CHECK_ACCESS(_res_ptr);
19652 LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr);
19653 FREE(untag_ptr(_res));
19654 CResult_COption_EventZDecodeErrorZ_free(_res_conv);
19657 static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) {
19658 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
19659 *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg);
19660 return tag_ptr(ret_conv, true);
19662 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19663 LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(arg);
19664 int64_t ret_conv = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv);
19668 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19669 LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(orig);
19670 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
19671 *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv);
19672 return tag_ptr(ret_conv, true);
19675 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
19676 LDKCVec_MessageSendEventZ _res_constr;
19677 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
19678 if (_res_constr.datalen > 0)
19679 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
19681 _res_constr.data = NULL;
19682 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
19683 for (size_t s = 0; s < _res_constr.datalen; s++) {
19684 int64_t _res_conv_18 = _res_vals[s];
19685 void* _res_conv_18_ptr = untag_ptr(_res_conv_18);
19686 CHECK_ACCESS(_res_conv_18_ptr);
19687 LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(_res_conv_18_ptr);
19688 FREE(untag_ptr(_res_conv_18));
19689 _res_constr.data[s] = _res_conv_18_conv;
19691 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
19692 CVec_MessageSendEventZ_free(_res_constr);
19695 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChainHashZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
19696 LDKCVec_ChainHashZ _res_constr;
19697 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
19698 if (_res_constr.datalen > 0)
19699 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ChainHashZ Elements");
19701 _res_constr.data = NULL;
19702 for (size_t i = 0; i < _res_constr.datalen; i++) {
19703 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
19704 LDKThirtyTwoBytes _res_conv_8_ref;
19705 CHECK((*env)->GetArrayLength(env, _res_conv_8) == 32);
19706 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 32, _res_conv_8_ref.data);
19707 _res_constr.data[i] = _res_conv_8_ref;
19709 CVec_ChainHashZ_free(_res_constr);
19712 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
19713 LDKPublicKey o_ref;
19714 CHECK((*env)->GetArrayLength(env, o) == 33);
19715 (*env)->GetByteArrayRegion(env, o, 0, 33, o_ref.compressed_form);
19716 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
19717 *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref);
19718 return tag_ptr(ret_conv, true);
19721 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
19722 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
19723 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
19724 *ret_conv = CResult_PublicKeyErrorZ_err(e_conv);
19725 return tag_ptr(ret_conv, true);
19728 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19729 LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(o);
19730 jboolean ret_conv = CResult_PublicKeyErrorZ_is_ok(o_conv);
19734 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19735 if (!ptr_is_owned(_res)) return;
19736 void* _res_ptr = untag_ptr(_res);
19737 CHECK_ACCESS(_res_ptr);
19738 LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr);
19739 FREE(untag_ptr(_res));
19740 CResult_PublicKeyErrorZ_free(_res_conv);
19743 static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) {
19744 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
19745 *ret_conv = CResult_PublicKeyErrorZ_clone(arg);
19746 return tag_ptr(ret_conv, true);
19748 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19749 LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(arg);
19750 int64_t ret_conv = CResult_PublicKeyErrorZ_clone_ptr(arg_conv);
19754 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19755 LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(orig);
19756 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
19757 *ret_conv = CResult_PublicKeyErrorZ_clone(orig_conv);
19758 return tag_ptr(ret_conv, true);
19761 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19763 o_conv.inner = untag_ptr(o);
19764 o_conv.is_owned = ptr_is_owned(o);
19765 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19766 o_conv = NodeId_clone(&o_conv);
19767 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
19768 *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv);
19769 return tag_ptr(ret_conv, true);
19772 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19773 void* e_ptr = untag_ptr(e);
19774 CHECK_ACCESS(e_ptr);
19775 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19776 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19777 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
19778 *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv);
19779 return tag_ptr(ret_conv, true);
19782 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19783 LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(o);
19784 jboolean ret_conv = CResult_NodeIdDecodeErrorZ_is_ok(o_conv);
19788 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19789 if (!ptr_is_owned(_res)) return;
19790 void* _res_ptr = untag_ptr(_res);
19791 CHECK_ACCESS(_res_ptr);
19792 LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr);
19793 FREE(untag_ptr(_res));
19794 CResult_NodeIdDecodeErrorZ_free(_res_conv);
19797 static inline uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) {
19798 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
19799 *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg);
19800 return tag_ptr(ret_conv, true);
19802 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19803 LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(arg);
19804 int64_t ret_conv = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv);
19808 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19809 LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(orig);
19810 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
19811 *ret_conv = CResult_NodeIdDecodeErrorZ_clone(orig_conv);
19812 return tag_ptr(ret_conv, true);
19815 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
19816 void* o_ptr = untag_ptr(o);
19817 CHECK_ACCESS(o_ptr);
19818 LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr);
19819 o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(o));
19820 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
19821 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv);
19822 return tag_ptr(ret_conv, true);
19825 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19826 void* e_ptr = untag_ptr(e);
19827 CHECK_ACCESS(e_ptr);
19828 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
19829 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
19830 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
19831 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv);
19832 return tag_ptr(ret_conv, true);
19835 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19836 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* o_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(o);
19837 jboolean ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o_conv);
19841 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19842 if (!ptr_is_owned(_res)) return;
19843 void* _res_ptr = untag_ptr(_res);
19844 CHECK_ACCESS(_res_ptr);
19845 LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr);
19846 FREE(untag_ptr(_res));
19847 CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res_conv);
19850 static inline uint64_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) {
19851 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
19852 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg);
19853 return tag_ptr(ret_conv, true);
19855 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19856 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(arg);
19857 int64_t ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv);
19861 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19862 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(orig);
19863 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
19864 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv);
19865 return tag_ptr(ret_conv, true);
19868 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1UtxoLookupZ_1some(JNIEnv *env, jclass clz, int64_t o) {
19869 void* o_ptr = untag_ptr(o);
19870 CHECK_ACCESS(o_ptr);
19871 LDKUtxoLookup o_conv = *(LDKUtxoLookup*)(o_ptr);
19872 if (o_conv.free == LDKUtxoLookup_JCalls_free) {
19873 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
19874 LDKUtxoLookup_JCalls_cloned(&o_conv);
19876 LDKCOption_UtxoLookupZ *ret_copy = MALLOC(sizeof(LDKCOption_UtxoLookupZ), "LDKCOption_UtxoLookupZ");
19877 *ret_copy = COption_UtxoLookupZ_some(o_conv);
19878 int64_t ret_ref = tag_ptr(ret_copy, true);
19882 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1UtxoLookupZ_1none(JNIEnv *env, jclass clz) {
19883 LDKCOption_UtxoLookupZ *ret_copy = MALLOC(sizeof(LDKCOption_UtxoLookupZ), "LDKCOption_UtxoLookupZ");
19884 *ret_copy = COption_UtxoLookupZ_none();
19885 int64_t ret_ref = tag_ptr(ret_copy, true);
19889 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1UtxoLookupZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19890 if (!ptr_is_owned(_res)) return;
19891 void* _res_ptr = untag_ptr(_res);
19892 CHECK_ACCESS(_res_ptr);
19893 LDKCOption_UtxoLookupZ _res_conv = *(LDKCOption_UtxoLookupZ*)(_res_ptr);
19894 FREE(untag_ptr(_res));
19895 COption_UtxoLookupZ_free(_res_conv);
19898 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv *env, jclass clz, jboolean o) {
19899 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
19900 *ret_conv = CResult_boolLightningErrorZ_ok(o);
19901 return tag_ptr(ret_conv, true);
19904 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
19905 LDKLightningError e_conv;
19906 e_conv.inner = untag_ptr(e);
19907 e_conv.is_owned = ptr_is_owned(e);
19908 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19909 e_conv = LightningError_clone(&e_conv);
19910 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
19911 *ret_conv = CResult_boolLightningErrorZ_err(e_conv);
19912 return tag_ptr(ret_conv, true);
19915 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
19916 LDKCResult_boolLightningErrorZ* o_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(o);
19917 jboolean ret_conv = CResult_boolLightningErrorZ_is_ok(o_conv);
19921 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19922 if (!ptr_is_owned(_res)) return;
19923 void* _res_ptr = untag_ptr(_res);
19924 CHECK_ACCESS(_res_ptr);
19925 LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(_res_ptr);
19926 FREE(untag_ptr(_res));
19927 CResult_boolLightningErrorZ_free(_res_conv);
19930 static inline uint64_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) {
19931 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
19932 *ret_conv = CResult_boolLightningErrorZ_clone(arg);
19933 return tag_ptr(ret_conv, true);
19935 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19936 LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(arg);
19937 int64_t ret_conv = CResult_boolLightningErrorZ_clone_ptr(arg_conv);
19941 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19942 LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(orig);
19943 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
19944 *ret_conv = CResult_boolLightningErrorZ_clone(orig_conv);
19945 return tag_ptr(ret_conv, true);
19948 static inline uint64_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) {
19949 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
19950 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg);
19951 return tag_ptr(ret_conv, true);
19953 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
19954 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(arg);
19955 int64_t ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv);
19959 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
19960 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(orig);
19961 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
19962 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig_conv);
19963 return tag_ptr(ret_conv, true);
19966 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) {
19967 LDKChannelAnnouncement a_conv;
19968 a_conv.inner = untag_ptr(a);
19969 a_conv.is_owned = ptr_is_owned(a);
19970 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
19971 a_conv = ChannelAnnouncement_clone(&a_conv);
19972 LDKChannelUpdate b_conv;
19973 b_conv.inner = untag_ptr(b);
19974 b_conv.is_owned = ptr_is_owned(b);
19975 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
19976 b_conv = ChannelUpdate_clone(&b_conv);
19977 LDKChannelUpdate c_conv;
19978 c_conv.inner = untag_ptr(c);
19979 c_conv.is_owned = ptr_is_owned(c);
19980 CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
19981 c_conv = ChannelUpdate_clone(&c_conv);
19982 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
19983 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
19984 return tag_ptr(ret_conv, true);
19987 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
19988 if (!ptr_is_owned(_res)) return;
19989 void* _res_ptr = untag_ptr(_res);
19990 CHECK_ACCESS(_res_ptr);
19991 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_ptr);
19992 FREE(untag_ptr(_res));
19993 C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res_conv);
19996 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1some(JNIEnv *env, jclass clz, int64_t o) {
19997 void* o_ptr = untag_ptr(o);
19998 CHECK_ACCESS(o_ptr);
19999 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(o_ptr);
20000 o_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone((LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(o));
20001 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
20002 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(o_conv);
20003 int64_t ret_ref = tag_ptr(ret_copy, true);
20007 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1none(JNIEnv *env, jclass clz) {
20008 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
20009 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none();
20010 int64_t ret_ref = tag_ptr(ret_copy, true);
20014 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20015 if (!ptr_is_owned(_res)) return;
20016 void* _res_ptr = untag_ptr(_res);
20017 CHECK_ACCESS(_res_ptr);
20018 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res_conv = *(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(_res_ptr);
20019 FREE(untag_ptr(_res));
20020 COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_conv);
20023 static inline uint64_t COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR arg) {
20024 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
20025 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(arg);
20026 int64_t ret_ref = tag_ptr(ret_copy, true);
20029 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20030 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* arg_conv = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(arg);
20031 int64_t ret_conv = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone_ptr(arg_conv);
20035 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20036 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* orig_conv = (LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)untag_ptr(orig);
20037 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *ret_copy = MALLOC(sizeof(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
20038 *ret_copy = COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(orig_conv);
20039 int64_t ret_ref = tag_ptr(ret_copy, true);
20043 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1ok(JNIEnv *env, jclass clz) {
20044 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
20045 *ret_conv = CResult_NoneLightningErrorZ_ok();
20046 return tag_ptr(ret_conv, true);
20049 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20050 LDKLightningError e_conv;
20051 e_conv.inner = untag_ptr(e);
20052 e_conv.is_owned = ptr_is_owned(e);
20053 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
20054 e_conv = LightningError_clone(&e_conv);
20055 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
20056 *ret_conv = CResult_NoneLightningErrorZ_err(e_conv);
20057 return tag_ptr(ret_conv, true);
20060 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20061 LDKCResult_NoneLightningErrorZ* o_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(o);
20062 jboolean ret_conv = CResult_NoneLightningErrorZ_is_ok(o_conv);
20066 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20067 if (!ptr_is_owned(_res)) return;
20068 void* _res_ptr = untag_ptr(_res);
20069 CHECK_ACCESS(_res_ptr);
20070 LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(_res_ptr);
20071 FREE(untag_ptr(_res));
20072 CResult_NoneLightningErrorZ_free(_res_conv);
20075 static inline uint64_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) {
20076 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
20077 *ret_conv = CResult_NoneLightningErrorZ_clone(arg);
20078 return tag_ptr(ret_conv, true);
20080 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20081 LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(arg);
20082 int64_t ret_conv = CResult_NoneLightningErrorZ_clone_ptr(arg_conv);
20086 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20087 LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(orig);
20088 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
20089 *ret_conv = CResult_NoneLightningErrorZ_clone(orig_conv);
20090 return tag_ptr(ret_conv, true);
20093 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20094 LDKChannelUpdateInfo o_conv;
20095 o_conv.inner = untag_ptr(o);
20096 o_conv.is_owned = ptr_is_owned(o);
20097 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20098 o_conv = ChannelUpdateInfo_clone(&o_conv);
20099 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
20100 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_ok(o_conv);
20101 return tag_ptr(ret_conv, true);
20104 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20105 void* e_ptr = untag_ptr(e);
20106 CHECK_ACCESS(e_ptr);
20107 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20108 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20109 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
20110 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_err(e_conv);
20111 return tag_ptr(ret_conv, true);
20114 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20115 LDKCResult_ChannelUpdateInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(o);
20116 jboolean ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(o_conv);
20120 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20121 if (!ptr_is_owned(_res)) return;
20122 void* _res_ptr = untag_ptr(_res);
20123 CHECK_ACCESS(_res_ptr);
20124 LDKCResult_ChannelUpdateInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(_res_ptr);
20125 FREE(untag_ptr(_res));
20126 CResult_ChannelUpdateInfoDecodeErrorZ_free(_res_conv);
20129 static inline uint64_t CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR arg) {
20130 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
20131 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(arg);
20132 return tag_ptr(ret_conv, true);
20134 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20135 LDKCResult_ChannelUpdateInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(arg);
20136 int64_t ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(arg_conv);
20140 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20141 LDKCResult_ChannelUpdateInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(orig);
20142 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
20143 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(orig_conv);
20144 return tag_ptr(ret_conv, true);
20147 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20148 LDKChannelInfo o_conv;
20149 o_conv.inner = untag_ptr(o);
20150 o_conv.is_owned = ptr_is_owned(o);
20151 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20152 o_conv = ChannelInfo_clone(&o_conv);
20153 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
20154 *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv);
20155 return tag_ptr(ret_conv, true);
20158 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20159 void* e_ptr = untag_ptr(e);
20160 CHECK_ACCESS(e_ptr);
20161 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20162 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20163 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
20164 *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv);
20165 return tag_ptr(ret_conv, true);
20168 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20169 LDKCResult_ChannelInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(o);
20170 jboolean ret_conv = CResult_ChannelInfoDecodeErrorZ_is_ok(o_conv);
20174 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20175 if (!ptr_is_owned(_res)) return;
20176 void* _res_ptr = untag_ptr(_res);
20177 CHECK_ACCESS(_res_ptr);
20178 LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(_res_ptr);
20179 FREE(untag_ptr(_res));
20180 CResult_ChannelInfoDecodeErrorZ_free(_res_conv);
20183 static inline uint64_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) {
20184 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
20185 *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg);
20186 return tag_ptr(ret_conv, true);
20188 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20189 LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(arg);
20190 int64_t ret_conv = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv);
20194 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20195 LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(orig);
20196 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
20197 *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(orig_conv);
20198 return tag_ptr(ret_conv, true);
20201 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20202 LDKRoutingFees o_conv;
20203 o_conv.inner = untag_ptr(o);
20204 o_conv.is_owned = ptr_is_owned(o);
20205 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20206 o_conv = RoutingFees_clone(&o_conv);
20207 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
20208 *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv);
20209 return tag_ptr(ret_conv, true);
20212 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20213 void* e_ptr = untag_ptr(e);
20214 CHECK_ACCESS(e_ptr);
20215 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20216 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20217 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
20218 *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv);
20219 return tag_ptr(ret_conv, true);
20222 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20223 LDKCResult_RoutingFeesDecodeErrorZ* o_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(o);
20224 jboolean ret_conv = CResult_RoutingFeesDecodeErrorZ_is_ok(o_conv);
20228 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20229 if (!ptr_is_owned(_res)) return;
20230 void* _res_ptr = untag_ptr(_res);
20231 CHECK_ACCESS(_res_ptr);
20232 LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(_res_ptr);
20233 FREE(untag_ptr(_res));
20234 CResult_RoutingFeesDecodeErrorZ_free(_res_conv);
20237 static inline uint64_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) {
20238 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
20239 *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg);
20240 return tag_ptr(ret_conv, true);
20242 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20243 LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(arg);
20244 int64_t ret_conv = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv);
20248 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20249 LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(orig);
20250 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
20251 *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(orig_conv);
20252 return tag_ptr(ret_conv, true);
20255 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
20256 LDKCVec_NetAddressZ _res_constr;
20257 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20258 if (_res_constr.datalen > 0)
20259 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
20261 _res_constr.data = NULL;
20262 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
20263 for (size_t m = 0; m < _res_constr.datalen; m++) {
20264 int64_t _res_conv_12 = _res_vals[m];
20265 void* _res_conv_12_ptr = untag_ptr(_res_conv_12);
20266 CHECK_ACCESS(_res_conv_12_ptr);
20267 LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(_res_conv_12_ptr);
20268 FREE(untag_ptr(_res_conv_12));
20269 _res_constr.data[m] = _res_conv_12_conv;
20271 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
20272 CVec_NetAddressZ_free(_res_constr);
20275 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20276 LDKNodeAnnouncementInfo o_conv;
20277 o_conv.inner = untag_ptr(o);
20278 o_conv.is_owned = ptr_is_owned(o);
20279 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20280 o_conv = NodeAnnouncementInfo_clone(&o_conv);
20281 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
20282 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv);
20283 return tag_ptr(ret_conv, true);
20286 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20287 void* e_ptr = untag_ptr(e);
20288 CHECK_ACCESS(e_ptr);
20289 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20290 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20291 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
20292 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv);
20293 return tag_ptr(ret_conv, true);
20296 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20297 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(o);
20298 jboolean ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o_conv);
20302 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20303 if (!ptr_is_owned(_res)) return;
20304 void* _res_ptr = untag_ptr(_res);
20305 CHECK_ACCESS(_res_ptr);
20306 LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(_res_ptr);
20307 FREE(untag_ptr(_res));
20308 CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv);
20311 static inline uint64_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) {
20312 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
20313 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg);
20314 return tag_ptr(ret_conv, true);
20316 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20317 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(arg);
20318 int64_t ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv);
20322 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20323 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(orig);
20324 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
20325 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig_conv);
20326 return tag_ptr(ret_conv, true);
20329 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20330 LDKNodeAlias o_conv;
20331 o_conv.inner = untag_ptr(o);
20332 o_conv.is_owned = ptr_is_owned(o);
20333 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20334 o_conv = NodeAlias_clone(&o_conv);
20335 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
20336 *ret_conv = CResult_NodeAliasDecodeErrorZ_ok(o_conv);
20337 return tag_ptr(ret_conv, true);
20340 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20341 void* e_ptr = untag_ptr(e);
20342 CHECK_ACCESS(e_ptr);
20343 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20344 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20345 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
20346 *ret_conv = CResult_NodeAliasDecodeErrorZ_err(e_conv);
20347 return tag_ptr(ret_conv, true);
20350 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20351 LDKCResult_NodeAliasDecodeErrorZ* o_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(o);
20352 jboolean ret_conv = CResult_NodeAliasDecodeErrorZ_is_ok(o_conv);
20356 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20357 if (!ptr_is_owned(_res)) return;
20358 void* _res_ptr = untag_ptr(_res);
20359 CHECK_ACCESS(_res_ptr);
20360 LDKCResult_NodeAliasDecodeErrorZ _res_conv = *(LDKCResult_NodeAliasDecodeErrorZ*)(_res_ptr);
20361 FREE(untag_ptr(_res));
20362 CResult_NodeAliasDecodeErrorZ_free(_res_conv);
20365 static inline uint64_t CResult_NodeAliasDecodeErrorZ_clone_ptr(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR arg) {
20366 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
20367 *ret_conv = CResult_NodeAliasDecodeErrorZ_clone(arg);
20368 return tag_ptr(ret_conv, true);
20370 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20371 LDKCResult_NodeAliasDecodeErrorZ* arg_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(arg);
20372 int64_t ret_conv = CResult_NodeAliasDecodeErrorZ_clone_ptr(arg_conv);
20376 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20377 LDKCResult_NodeAliasDecodeErrorZ* orig_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(orig);
20378 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
20379 *ret_conv = CResult_NodeAliasDecodeErrorZ_clone(orig_conv);
20380 return tag_ptr(ret_conv, true);
20383 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20384 LDKNodeInfo o_conv;
20385 o_conv.inner = untag_ptr(o);
20386 o_conv.is_owned = ptr_is_owned(o);
20387 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20388 o_conv = NodeInfo_clone(&o_conv);
20389 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
20390 *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv);
20391 return tag_ptr(ret_conv, true);
20394 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20395 void* e_ptr = untag_ptr(e);
20396 CHECK_ACCESS(e_ptr);
20397 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20398 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20399 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
20400 *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv);
20401 return tag_ptr(ret_conv, true);
20404 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20405 LDKCResult_NodeInfoDecodeErrorZ* o_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(o);
20406 jboolean ret_conv = CResult_NodeInfoDecodeErrorZ_is_ok(o_conv);
20410 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20411 if (!ptr_is_owned(_res)) return;
20412 void* _res_ptr = untag_ptr(_res);
20413 CHECK_ACCESS(_res_ptr);
20414 LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(_res_ptr);
20415 FREE(untag_ptr(_res));
20416 CResult_NodeInfoDecodeErrorZ_free(_res_conv);
20419 static inline uint64_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) {
20420 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
20421 *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg);
20422 return tag_ptr(ret_conv, true);
20424 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20425 LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(arg);
20426 int64_t ret_conv = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv);
20430 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20431 LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(orig);
20432 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
20433 *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(orig_conv);
20434 return tag_ptr(ret_conv, true);
20437 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20438 LDKNetworkGraph o_conv;
20439 o_conv.inner = untag_ptr(o);
20440 o_conv.is_owned = ptr_is_owned(o);
20441 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20442 // WARNING: we need a move here but no clone is available for LDKNetworkGraph
20444 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
20445 *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv);
20446 return tag_ptr(ret_conv, true);
20449 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20450 void* e_ptr = untag_ptr(e);
20451 CHECK_ACCESS(e_ptr);
20452 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20453 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20454 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
20455 *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv);
20456 return tag_ptr(ret_conv, true);
20459 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20460 LDKCResult_NetworkGraphDecodeErrorZ* o_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(o);
20461 jboolean ret_conv = CResult_NetworkGraphDecodeErrorZ_is_ok(o_conv);
20465 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20466 if (!ptr_is_owned(_res)) return;
20467 void* _res_ptr = untag_ptr(_res);
20468 CHECK_ACCESS(_res_ptr);
20469 LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(_res_ptr);
20470 FREE(untag_ptr(_res));
20471 CResult_NetworkGraphDecodeErrorZ_free(_res_conv);
20474 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1some(JNIEnv *env, jclass clz, int64_tArray o) {
20475 LDKCVec_NetAddressZ o_constr;
20476 o_constr.datalen = (*env)->GetArrayLength(env, o);
20477 if (o_constr.datalen > 0)
20478 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
20480 o_constr.data = NULL;
20481 int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL);
20482 for (size_t m = 0; m < o_constr.datalen; m++) {
20483 int64_t o_conv_12 = o_vals[m];
20484 void* o_conv_12_ptr = untag_ptr(o_conv_12);
20485 CHECK_ACCESS(o_conv_12_ptr);
20486 LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(o_conv_12_ptr);
20487 o_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o_conv_12));
20488 o_constr.data[m] = o_conv_12_conv;
20490 (*env)->ReleaseLongArrayElements(env, o, o_vals, 0);
20491 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
20492 *ret_copy = COption_CVec_NetAddressZZ_some(o_constr);
20493 int64_t ret_ref = tag_ptr(ret_copy, true);
20497 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1none(JNIEnv *env, jclass clz) {
20498 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
20499 *ret_copy = COption_CVec_NetAddressZZ_none();
20500 int64_t ret_ref = tag_ptr(ret_copy, true);
20504 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20505 if (!ptr_is_owned(_res)) return;
20506 void* _res_ptr = untag_ptr(_res);
20507 CHECK_ACCESS(_res_ptr);
20508 LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(_res_ptr);
20509 FREE(untag_ptr(_res));
20510 COption_CVec_NetAddressZZ_free(_res_conv);
20513 static inline uint64_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) {
20514 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
20515 *ret_copy = COption_CVec_NetAddressZZ_clone(arg);
20516 int64_t ret_ref = tag_ptr(ret_copy, true);
20519 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20520 LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(arg);
20521 int64_t ret_conv = COption_CVec_NetAddressZZ_clone_ptr(arg_conv);
20525 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CVec_1NetAddressZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20526 LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(orig);
20527 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
20528 *ret_copy = COption_CVec_NetAddressZZ_clone(orig_conv);
20529 int64_t ret_ref = tag_ptr(ret_copy, true);
20533 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20534 LDKDelayedPaymentOutputDescriptor o_conv;
20535 o_conv.inner = untag_ptr(o);
20536 o_conv.is_owned = ptr_is_owned(o);
20537 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20538 o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv);
20539 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
20540 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
20541 return tag_ptr(ret_conv, true);
20544 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20545 void* e_ptr = untag_ptr(e);
20546 CHECK_ACCESS(e_ptr);
20547 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20548 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20549 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
20550 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
20551 return tag_ptr(ret_conv, true);
20554 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20555 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(o);
20556 jboolean ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
20560 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20561 if (!ptr_is_owned(_res)) return;
20562 void* _res_ptr = untag_ptr(_res);
20563 CHECK_ACCESS(_res_ptr);
20564 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
20565 FREE(untag_ptr(_res));
20566 CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
20569 static inline uint64_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
20570 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
20571 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg);
20572 return tag_ptr(ret_conv, true);
20574 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20575 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
20576 int64_t ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
20580 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20581 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
20582 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
20583 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv);
20584 return tag_ptr(ret_conv, true);
20587 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20588 LDKStaticPaymentOutputDescriptor o_conv;
20589 o_conv.inner = untag_ptr(o);
20590 o_conv.is_owned = ptr_is_owned(o);
20591 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
20592 o_conv = StaticPaymentOutputDescriptor_clone(&o_conv);
20593 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
20594 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
20595 return tag_ptr(ret_conv, true);
20598 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20599 void* e_ptr = untag_ptr(e);
20600 CHECK_ACCESS(e_ptr);
20601 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20602 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20603 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
20604 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
20605 return tag_ptr(ret_conv, true);
20608 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20609 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(o);
20610 jboolean ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
20614 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20615 if (!ptr_is_owned(_res)) return;
20616 void* _res_ptr = untag_ptr(_res);
20617 CHECK_ACCESS(_res_ptr);
20618 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
20619 FREE(untag_ptr(_res));
20620 CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
20623 static inline uint64_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
20624 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
20625 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg);
20626 return tag_ptr(ret_conv, true);
20628 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20629 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
20630 int64_t ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
20634 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20635 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
20636 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
20637 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv);
20638 return tag_ptr(ret_conv, true);
20641 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20642 void* o_ptr = untag_ptr(o);
20643 CHECK_ACCESS(o_ptr);
20644 LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(o_ptr);
20645 o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(o));
20646 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
20647 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv);
20648 return tag_ptr(ret_conv, true);
20651 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
20652 void* e_ptr = untag_ptr(e);
20653 CHECK_ACCESS(e_ptr);
20654 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
20655 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
20656 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
20657 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv);
20658 return tag_ptr(ret_conv, true);
20661 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20662 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(o);
20663 jboolean ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o_conv);
20667 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20668 if (!ptr_is_owned(_res)) return;
20669 void* _res_ptr = untag_ptr(_res);
20670 CHECK_ACCESS(_res_ptr);
20671 LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(_res_ptr);
20672 FREE(untag_ptr(_res));
20673 CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv);
20676 static inline uint64_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
20677 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
20678 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg);
20679 return tag_ptr(ret_conv, true);
20681 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20682 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
20683 int64_t ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
20687 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20688 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
20689 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
20690 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig_conv);
20691 return tag_ptr(ret_conv, true);
20694 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PaymentPreimageZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
20695 LDKCVec_PaymentPreimageZ _res_constr;
20696 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
20697 if (_res_constr.datalen > 0)
20698 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
20700 _res_constr.data = NULL;
20701 for (size_t i = 0; i < _res_constr.datalen; i++) {
20702 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
20703 LDKThirtyTwoBytes _res_conv_8_ref;
20704 CHECK((*env)->GetArrayLength(env, _res_conv_8) == 32);
20705 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 32, _res_conv_8_ref.data);
20706 _res_constr.data[i] = _res_conv_8_ref;
20708 CVec_PaymentPreimageZ_free(_res_constr);
20711 static inline uint64_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) {
20712 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
20713 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg);
20714 return tag_ptr(ret_conv, true);
20716 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20717 LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(arg);
20718 int64_t ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv);
20722 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20723 LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(orig);
20724 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
20725 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(orig_conv);
20726 return tag_ptr(ret_conv, true);
20729 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, jobjectArray b) {
20730 LDKSignature a_ref;
20731 CHECK((*env)->GetArrayLength(env, a) == 64);
20732 (*env)->GetByteArrayRegion(env, a, 0, 64, a_ref.compact_form);
20733 LDKCVec_SignatureZ b_constr;
20734 b_constr.datalen = (*env)->GetArrayLength(env, b);
20735 if (b_constr.datalen > 0)
20736 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
20738 b_constr.data = NULL;
20739 for (size_t i = 0; i < b_constr.datalen; i++) {
20740 int8_tArray b_conv_8 = (*env)->GetObjectArrayElement(env, b, i);
20741 LDKSignature b_conv_8_ref;
20742 CHECK((*env)->GetArrayLength(env, b_conv_8) == 64);
20743 (*env)->GetByteArrayRegion(env, b_conv_8, 0, 64, b_conv_8_ref.compact_form);
20744 b_constr.data[i] = b_conv_8_ref;
20746 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
20747 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr);
20748 return tag_ptr(ret_conv, true);
20751 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20752 if (!ptr_is_owned(_res)) return;
20753 void* _res_ptr = untag_ptr(_res);
20754 CHECK_ACCESS(_res_ptr);
20755 LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(_res_ptr);
20756 FREE(untag_ptr(_res));
20757 C2Tuple_SignatureCVec_SignatureZZ_free(_res_conv);
20760 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
20761 void* o_ptr = untag_ptr(o);
20762 CHECK_ACCESS(o_ptr);
20763 LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(o_ptr);
20764 o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(o));
20765 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
20766 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv);
20767 return tag_ptr(ret_conv, true);
20770 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv *env, jclass clz) {
20771 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
20772 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
20773 return tag_ptr(ret_conv, true);
20776 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20777 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(o);
20778 jboolean ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o_conv);
20782 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20783 if (!ptr_is_owned(_res)) return;
20784 void* _res_ptr = untag_ptr(_res);
20785 CHECK_ACCESS(_res_ptr);
20786 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(_res_ptr);
20787 FREE(untag_ptr(_res));
20788 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv);
20791 static inline uint64_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) {
20792 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
20793 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg);
20794 return tag_ptr(ret_conv, true);
20796 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20797 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(arg);
20798 int64_t ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv);
20802 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20803 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(orig);
20804 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
20805 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig_conv);
20806 return tag_ptr(ret_conv, true);
20809 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
20810 LDKSignature o_ref;
20811 CHECK((*env)->GetArrayLength(env, o) == 64);
20812 (*env)->GetByteArrayRegion(env, o, 0, 64, o_ref.compact_form);
20813 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
20814 *ret_conv = CResult_SignatureNoneZ_ok(o_ref);
20815 return tag_ptr(ret_conv, true);
20818 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv *env, jclass clz) {
20819 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
20820 *ret_conv = CResult_SignatureNoneZ_err();
20821 return tag_ptr(ret_conv, true);
20824 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20825 LDKCResult_SignatureNoneZ* o_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(o);
20826 jboolean ret_conv = CResult_SignatureNoneZ_is_ok(o_conv);
20830 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20831 if (!ptr_is_owned(_res)) return;
20832 void* _res_ptr = untag_ptr(_res);
20833 CHECK_ACCESS(_res_ptr);
20834 LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(_res_ptr);
20835 FREE(untag_ptr(_res));
20836 CResult_SignatureNoneZ_free(_res_conv);
20839 static inline uint64_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) {
20840 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
20841 *ret_conv = CResult_SignatureNoneZ_clone(arg);
20842 return tag_ptr(ret_conv, true);
20844 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20845 LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(arg);
20846 int64_t ret_conv = CResult_SignatureNoneZ_clone_ptr(arg_conv);
20850 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20851 LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(orig);
20852 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
20853 *ret_conv = CResult_SignatureNoneZ_clone(orig_conv);
20854 return tag_ptr(ret_conv, true);
20857 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
20858 LDKPublicKey o_ref;
20859 CHECK((*env)->GetArrayLength(env, o) == 33);
20860 (*env)->GetByteArrayRegion(env, o, 0, 33, o_ref.compressed_form);
20861 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
20862 *ret_conv = CResult_PublicKeyNoneZ_ok(o_ref);
20863 return tag_ptr(ret_conv, true);
20866 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1err(JNIEnv *env, jclass clz) {
20867 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
20868 *ret_conv = CResult_PublicKeyNoneZ_err();
20869 return tag_ptr(ret_conv, true);
20872 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20873 LDKCResult_PublicKeyNoneZ* o_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(o);
20874 jboolean ret_conv = CResult_PublicKeyNoneZ_is_ok(o_conv);
20878 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20879 if (!ptr_is_owned(_res)) return;
20880 void* _res_ptr = untag_ptr(_res);
20881 CHECK_ACCESS(_res_ptr);
20882 LDKCResult_PublicKeyNoneZ _res_conv = *(LDKCResult_PublicKeyNoneZ*)(_res_ptr);
20883 FREE(untag_ptr(_res));
20884 CResult_PublicKeyNoneZ_free(_res_conv);
20887 static inline uint64_t CResult_PublicKeyNoneZ_clone_ptr(LDKCResult_PublicKeyNoneZ *NONNULL_PTR arg) {
20888 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
20889 *ret_conv = CResult_PublicKeyNoneZ_clone(arg);
20890 return tag_ptr(ret_conv, true);
20892 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20893 LDKCResult_PublicKeyNoneZ* arg_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(arg);
20894 int64_t ret_conv = CResult_PublicKeyNoneZ_clone_ptr(arg_conv);
20898 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20899 LDKCResult_PublicKeyNoneZ* orig_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(orig);
20900 LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
20901 *ret_conv = CResult_PublicKeyNoneZ_clone(orig_conv);
20902 return tag_ptr(ret_conv, true);
20905 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1some(JNIEnv *env, jclass clz, int64_t o) {
20906 void* o_ptr = untag_ptr(o);
20907 CHECK_ACCESS(o_ptr);
20908 LDKBigEndianScalar o_conv = *(LDKBigEndianScalar*)(o_ptr);
20909 // WARNING: we may need a move here but no clone is available for LDKBigEndianScalar
20910 LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
20911 *ret_copy = COption_ScalarZ_some(o_conv);
20912 int64_t ret_ref = tag_ptr(ret_copy, true);
20916 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1none(JNIEnv *env, jclass clz) {
20917 LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
20918 *ret_copy = COption_ScalarZ_none();
20919 int64_t ret_ref = tag_ptr(ret_copy, true);
20923 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20924 if (!ptr_is_owned(_res)) return;
20925 void* _res_ptr = untag_ptr(_res);
20926 CHECK_ACCESS(_res_ptr);
20927 LDKCOption_ScalarZ _res_conv = *(LDKCOption_ScalarZ*)(_res_ptr);
20928 FREE(untag_ptr(_res));
20929 COption_ScalarZ_free(_res_conv);
20932 static inline uint64_t COption_ScalarZ_clone_ptr(LDKCOption_ScalarZ *NONNULL_PTR arg) {
20933 LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
20934 *ret_copy = COption_ScalarZ_clone(arg);
20935 int64_t ret_ref = tag_ptr(ret_copy, true);
20938 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20939 LDKCOption_ScalarZ* arg_conv = (LDKCOption_ScalarZ*)untag_ptr(arg);
20940 int64_t ret_conv = COption_ScalarZ_clone_ptr(arg_conv);
20944 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20945 LDKCOption_ScalarZ* orig_conv = (LDKCOption_ScalarZ*)untag_ptr(orig);
20946 LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
20947 *ret_copy = COption_ScalarZ_clone(orig_conv);
20948 int64_t ret_ref = tag_ptr(ret_copy, true);
20952 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
20953 LDKThirtyTwoBytes o_ref;
20954 CHECK((*env)->GetArrayLength(env, o) == 32);
20955 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
20956 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
20957 *ret_conv = CResult_SharedSecretNoneZ_ok(o_ref);
20958 return tag_ptr(ret_conv, true);
20961 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1err(JNIEnv *env, jclass clz) {
20962 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
20963 *ret_conv = CResult_SharedSecretNoneZ_err();
20964 return tag_ptr(ret_conv, true);
20967 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
20968 LDKCResult_SharedSecretNoneZ* o_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(o);
20969 jboolean ret_conv = CResult_SharedSecretNoneZ_is_ok(o_conv);
20973 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
20974 if (!ptr_is_owned(_res)) return;
20975 void* _res_ptr = untag_ptr(_res);
20976 CHECK_ACCESS(_res_ptr);
20977 LDKCResult_SharedSecretNoneZ _res_conv = *(LDKCResult_SharedSecretNoneZ*)(_res_ptr);
20978 FREE(untag_ptr(_res));
20979 CResult_SharedSecretNoneZ_free(_res_conv);
20982 static inline uint64_t CResult_SharedSecretNoneZ_clone_ptr(LDKCResult_SharedSecretNoneZ *NONNULL_PTR arg) {
20983 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
20984 *ret_conv = CResult_SharedSecretNoneZ_clone(arg);
20985 return tag_ptr(ret_conv, true);
20987 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
20988 LDKCResult_SharedSecretNoneZ* arg_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(arg);
20989 int64_t ret_conv = CResult_SharedSecretNoneZ_clone_ptr(arg_conv);
20993 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
20994 LDKCResult_SharedSecretNoneZ* orig_conv = (LDKCResult_SharedSecretNoneZ*)untag_ptr(orig);
20995 LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
20996 *ret_conv = CResult_SharedSecretNoneZ_clone(orig_conv);
20997 return tag_ptr(ret_conv, true);
21000 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1U5Z_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
21001 LDKCVec_U5Z _res_constr;
21002 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
21003 if (_res_constr.datalen > 0)
21004 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements");
21006 _res_constr.data = NULL;
21007 int8_t* _res_vals = (*env)->GetByteArrayElements (env, _res, NULL);
21008 for (size_t h = 0; h < _res_constr.datalen; h++) {
21009 int8_t _res_conv_7 = _res_vals[h];
21011 _res_constr.data[h] = (LDKU5){ ._0 = _res_conv_7 };
21013 (*env)->ReleaseByteArrayElements(env, _res, _res_vals, 0);
21014 CVec_U5Z_free(_res_constr);
21017 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
21018 LDKRecoverableSignature o_ref;
21019 CHECK((*env)->GetArrayLength(env, o) == 68);
21020 (*env)->GetByteArrayRegion(env, o, 0, 68, o_ref.serialized_form);
21021 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
21022 *ret_conv = CResult_RecoverableSignatureNoneZ_ok(o_ref);
21023 return tag_ptr(ret_conv, true);
21026 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1err(JNIEnv *env, jclass clz) {
21027 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
21028 *ret_conv = CResult_RecoverableSignatureNoneZ_err();
21029 return tag_ptr(ret_conv, true);
21032 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21033 LDKCResult_RecoverableSignatureNoneZ* o_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(o);
21034 jboolean ret_conv = CResult_RecoverableSignatureNoneZ_is_ok(o_conv);
21038 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21039 if (!ptr_is_owned(_res)) return;
21040 void* _res_ptr = untag_ptr(_res);
21041 CHECK_ACCESS(_res_ptr);
21042 LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(_res_ptr);
21043 FREE(untag_ptr(_res));
21044 CResult_RecoverableSignatureNoneZ_free(_res_conv);
21047 static inline uint64_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) {
21048 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
21049 *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg);
21050 return tag_ptr(ret_conv, true);
21052 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21053 LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(arg);
21054 int64_t ret_conv = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv);
21058 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21059 LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(orig);
21060 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
21061 *ret_conv = CResult_RecoverableSignatureNoneZ_clone(orig_conv);
21062 return tag_ptr(ret_conv, true);
21065 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21066 void* o_ptr = untag_ptr(o);
21067 CHECK_ACCESS(o_ptr);
21068 LDKWriteableEcdsaChannelSigner o_conv = *(LDKWriteableEcdsaChannelSigner*)(o_ptr);
21069 if (o_conv.free == LDKWriteableEcdsaChannelSigner_JCalls_free) {
21070 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
21071 LDKWriteableEcdsaChannelSigner_JCalls_cloned(&o_conv);
21073 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ");
21074 *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(o_conv);
21075 return tag_ptr(ret_conv, true);
21078 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21079 void* e_ptr = untag_ptr(e);
21080 CHECK_ACCESS(e_ptr);
21081 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
21082 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
21083 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ");
21084 *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(e_conv);
21085 return tag_ptr(ret_conv, true);
21088 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21089 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* o_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(o);
21090 jboolean ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(o_conv);
21094 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21095 if (!ptr_is_owned(_res)) return;
21096 void* _res_ptr = untag_ptr(_res);
21097 CHECK_ACCESS(_res_ptr);
21098 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res_conv = *(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)(_res_ptr);
21099 FREE(untag_ptr(_res));
21100 CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(_res_conv);
21103 static inline uint64_t CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR arg) {
21104 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ");
21105 *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(arg);
21106 return tag_ptr(ret_conv, true);
21108 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21109 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* arg_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(arg);
21110 int64_t ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone_ptr(arg_conv);
21114 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WriteableEcdsaChannelSignerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21115 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* orig_conv = (LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ*)untag_ptr(orig);
21116 LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ), "LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ");
21117 *ret_conv = CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(orig_conv);
21118 return tag_ptr(ret_conv, true);
21121 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1u8ZZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
21122 LDKCVec_CVec_u8ZZ _res_constr;
21123 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
21124 if (_res_constr.datalen > 0)
21125 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
21127 _res_constr.data = NULL;
21128 for (size_t i = 0; i < _res_constr.datalen; i++) {
21129 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
21130 LDKCVec_u8Z _res_conv_8_ref;
21131 _res_conv_8_ref.datalen = (*env)->GetArrayLength(env, _res_conv_8);
21132 _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKCVec_u8Z Bytes");
21133 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, _res_conv_8_ref.datalen, _res_conv_8_ref.data);
21134 _res_constr.data[i] = _res_conv_8_ref;
21136 CVec_CVec_u8ZZ_free(_res_constr);
21139 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1ok(JNIEnv *env, jclass clz, jobjectArray o) {
21140 LDKCVec_CVec_u8ZZ o_constr;
21141 o_constr.datalen = (*env)->GetArrayLength(env, o);
21142 if (o_constr.datalen > 0)
21143 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
21145 o_constr.data = NULL;
21146 for (size_t i = 0; i < o_constr.datalen; i++) {
21147 int8_tArray o_conv_8 = (*env)->GetObjectArrayElement(env, o, i);
21148 LDKCVec_u8Z o_conv_8_ref;
21149 o_conv_8_ref.datalen = (*env)->GetArrayLength(env, o_conv_8);
21150 o_conv_8_ref.data = MALLOC(o_conv_8_ref.datalen, "LDKCVec_u8Z Bytes");
21151 (*env)->GetByteArrayRegion(env, o_conv_8, 0, o_conv_8_ref.datalen, o_conv_8_ref.data);
21152 o_constr.data[i] = o_conv_8_ref;
21154 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
21155 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr);
21156 return tag_ptr(ret_conv, true);
21159 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1err(JNIEnv *env, jclass clz) {
21160 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
21161 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_err();
21162 return tag_ptr(ret_conv, true);
21165 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21166 LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(o);
21167 jboolean ret_conv = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv);
21171 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21172 if (!ptr_is_owned(_res)) return;
21173 void* _res_ptr = untag_ptr(_res);
21174 CHECK_ACCESS(_res_ptr);
21175 LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr);
21176 FREE(untag_ptr(_res));
21177 CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv);
21180 static inline uint64_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) {
21181 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
21182 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg);
21183 return tag_ptr(ret_conv, true);
21185 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21186 LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(arg);
21187 int64_t ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv);
21191 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1CVec_1u8ZZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21192 LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(orig);
21193 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
21194 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(orig_conv);
21195 return tag_ptr(ret_conv, true);
21198 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21199 LDKInMemorySigner o_conv;
21200 o_conv.inner = untag_ptr(o);
21201 o_conv.is_owned = ptr_is_owned(o);
21202 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21203 o_conv = InMemorySigner_clone(&o_conv);
21204 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
21205 *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv);
21206 return tag_ptr(ret_conv, true);
21209 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21210 void* e_ptr = untag_ptr(e);
21211 CHECK_ACCESS(e_ptr);
21212 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
21213 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
21214 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
21215 *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv);
21216 return tag_ptr(ret_conv, true);
21219 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21220 LDKCResult_InMemorySignerDecodeErrorZ* o_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(o);
21221 jboolean ret_conv = CResult_InMemorySignerDecodeErrorZ_is_ok(o_conv);
21225 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21226 if (!ptr_is_owned(_res)) return;
21227 void* _res_ptr = untag_ptr(_res);
21228 CHECK_ACCESS(_res_ptr);
21229 LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(_res_ptr);
21230 FREE(untag_ptr(_res));
21231 CResult_InMemorySignerDecodeErrorZ_free(_res_conv);
21234 static inline uint64_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) {
21235 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
21236 *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg);
21237 return tag_ptr(ret_conv, true);
21239 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21240 LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(arg);
21241 int64_t ret_conv = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv);
21245 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21246 LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(orig);
21247 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
21248 *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(orig_conv);
21249 return tag_ptr(ret_conv, true);
21252 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
21253 LDKCVec_TxOutZ _res_constr;
21254 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
21255 if (_res_constr.datalen > 0)
21256 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
21258 _res_constr.data = NULL;
21259 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
21260 for (size_t h = 0; h < _res_constr.datalen; h++) {
21261 int64_t _res_conv_7 = _res_vals[h];
21262 void* _res_conv_7_ptr = untag_ptr(_res_conv_7);
21263 CHECK_ACCESS(_res_conv_7_ptr);
21264 LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(_res_conv_7_ptr);
21265 FREE(untag_ptr(_res_conv_7));
21266 _res_constr.data[h] = _res_conv_7_conv;
21268 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
21269 CVec_TxOutZ_free(_res_constr);
21272 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
21273 LDKTransaction o_ref;
21274 o_ref.datalen = (*env)->GetArrayLength(env, o);
21275 o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes");
21276 (*env)->GetByteArrayRegion(env, o, 0, o_ref.datalen, o_ref.data);
21277 o_ref.data_is_owned = true;
21278 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
21279 *ret_conv = CResult_TransactionNoneZ_ok(o_ref);
21280 return tag_ptr(ret_conv, true);
21283 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1err(JNIEnv *env, jclass clz) {
21284 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
21285 *ret_conv = CResult_TransactionNoneZ_err();
21286 return tag_ptr(ret_conv, true);
21289 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21290 LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(o);
21291 jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv);
21295 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21296 if (!ptr_is_owned(_res)) return;
21297 void* _res_ptr = untag_ptr(_res);
21298 CHECK_ACCESS(_res_ptr);
21299 LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr);
21300 FREE(untag_ptr(_res));
21301 CResult_TransactionNoneZ_free(_res_conv);
21304 static inline uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) {
21305 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
21306 *ret_conv = CResult_TransactionNoneZ_clone(arg);
21307 return tag_ptr(ret_conv, true);
21309 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21310 LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(arg);
21311 int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv);
21315 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TransactionNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21316 LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(orig);
21317 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
21318 *ret_conv = CResult_TransactionNoneZ_clone(orig_conv);
21319 return tag_ptr(ret_conv, true);
21322 static inline uint64_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) {
21323 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
21324 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg);
21325 return tag_ptr(ret_conv, true);
21327 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21328 LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(arg);
21329 int64_t ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv);
21333 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21334 LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(orig);
21335 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
21336 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(orig_conv);
21337 return tag_ptr(ret_conv, true);
21340 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
21341 LDKThirtyTwoBytes a_ref;
21342 CHECK((*env)->GetArrayLength(env, a) == 32);
21343 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
21344 LDKChannelMonitor b_conv;
21345 b_conv.inner = untag_ptr(b);
21346 b_conv.is_owned = ptr_is_owned(b);
21347 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
21348 b_conv = ChannelMonitor_clone(&b_conv);
21349 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
21350 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv);
21351 return tag_ptr(ret_conv, true);
21354 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21355 if (!ptr_is_owned(_res)) return;
21356 void* _res_ptr = untag_ptr(_res);
21357 CHECK_ACCESS(_res_ptr);
21358 LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_ptr);
21359 FREE(untag_ptr(_res));
21360 C2Tuple_BlockHashChannelMonitorZ_free(_res_conv);
21363 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1BlockHashChannelMonitorZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
21364 LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res_constr;
21365 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
21366 if (_res_constr.datalen > 0)
21367 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Elements");
21369 _res_constr.data = NULL;
21370 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
21371 for (size_t j = 0; j < _res_constr.datalen; j++) {
21372 int64_t _res_conv_35 = _res_vals[j];
21373 void* _res_conv_35_ptr = untag_ptr(_res_conv_35);
21374 CHECK_ACCESS(_res_conv_35_ptr);
21375 LDKC2Tuple_BlockHashChannelMonitorZ _res_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_conv_35_ptr);
21376 FREE(untag_ptr(_res_conv_35));
21377 _res_constr.data[j] = _res_conv_35_conv;
21379 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
21380 CVec_C2Tuple_BlockHashChannelMonitorZZ_free(_res_constr);
21383 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1ok(JNIEnv *env, jclass clz, int64_tArray o) {
21384 LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o_constr;
21385 o_constr.datalen = (*env)->GetArrayLength(env, o);
21386 if (o_constr.datalen > 0)
21387 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKCVec_C2Tuple_BlockHashChannelMonitorZZ Elements");
21389 o_constr.data = NULL;
21390 int64_t* o_vals = (*env)->GetLongArrayElements (env, o, NULL);
21391 for (size_t j = 0; j < o_constr.datalen; j++) {
21392 int64_t o_conv_35 = o_vals[j];
21393 void* o_conv_35_ptr = untag_ptr(o_conv_35);
21394 CHECK_ACCESS(o_conv_35_ptr);
21395 LDKC2Tuple_BlockHashChannelMonitorZ o_conv_35_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_conv_35_ptr);
21396 o_conv_35_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(o_conv_35));
21397 o_constr.data[j] = o_conv_35_conv;
21399 (*env)->ReleaseLongArrayElements(env, o, o_vals, 0);
21400 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
21401 *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(o_constr);
21402 return tag_ptr(ret_conv, true);
21405 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
21406 LDKIOError e_conv = LDKIOError_from_java(env, e);
21407 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
21408 *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(e_conv);
21409 return tag_ptr(ret_conv, true);
21412 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21413 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* o_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(o);
21414 jboolean ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(o_conv);
21418 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21419 if (!ptr_is_owned(_res)) return;
21420 void* _res_ptr = untag_ptr(_res);
21421 CHECK_ACCESS(_res_ptr);
21422 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res_conv = *(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)(_res_ptr);
21423 FREE(untag_ptr(_res));
21424 CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(_res_conv);
21427 static inline uint64_t CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR arg) {
21428 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
21429 *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(arg);
21430 return tag_ptr(ret_conv, true);
21432 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21433 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* arg_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(arg);
21434 int64_t ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone_ptr(arg_conv);
21438 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1C2Tuple_1BlockHashChannelMonitorZZErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21439 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* orig_conv = (LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ*)untag_ptr(orig);
21440 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
21441 *ret_conv = CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_clone(orig_conv);
21442 return tag_ptr(ret_conv, true);
21445 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1some(JNIEnv *env, jclass clz, int16_t o) {
21446 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
21447 *ret_copy = COption_u16Z_some(o);
21448 int64_t ret_ref = tag_ptr(ret_copy, true);
21452 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1none(JNIEnv *env, jclass clz) {
21453 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
21454 *ret_copy = COption_u16Z_none();
21455 int64_t ret_ref = tag_ptr(ret_copy, true);
21459 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1free(JNIEnv *env, jclass clz, int64_t _res) {
21460 if (!ptr_is_owned(_res)) return;
21461 void* _res_ptr = untag_ptr(_res);
21462 CHECK_ACCESS(_res_ptr);
21463 LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(_res_ptr);
21464 FREE(untag_ptr(_res));
21465 COption_u16Z_free(_res_conv);
21468 static inline uint64_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) {
21469 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
21470 *ret_copy = COption_u16Z_clone(arg);
21471 int64_t ret_ref = tag_ptr(ret_copy, true);
21474 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21475 LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)untag_ptr(arg);
21476 int64_t ret_conv = COption_u16Z_clone_ptr(arg_conv);
21480 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u16Z_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21481 LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)untag_ptr(orig);
21482 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
21483 *ret_copy = COption_u16Z_clone(orig_conv);
21484 int64_t ret_ref = tag_ptr(ret_copy, true);
21488 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
21489 LDKThirtyTwoBytes o_ref;
21490 CHECK((*env)->GetArrayLength(env, o) == 32);
21491 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
21492 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
21493 *ret_conv = CResult__u832APIErrorZ_ok(o_ref);
21494 return tag_ptr(ret_conv, true);
21497 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21498 void* e_ptr = untag_ptr(e);
21499 CHECK_ACCESS(e_ptr);
21500 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
21501 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
21502 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
21503 *ret_conv = CResult__u832APIErrorZ_err(e_conv);
21504 return tag_ptr(ret_conv, true);
21507 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21508 LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(o);
21509 jboolean ret_conv = CResult__u832APIErrorZ_is_ok(o_conv);
21513 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21514 if (!ptr_is_owned(_res)) return;
21515 void* _res_ptr = untag_ptr(_res);
21516 CHECK_ACCESS(_res_ptr);
21517 LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr);
21518 FREE(untag_ptr(_res));
21519 CResult__u832APIErrorZ_free(_res_conv);
21522 static inline uint64_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) {
21523 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
21524 *ret_conv = CResult__u832APIErrorZ_clone(arg);
21525 return tag_ptr(ret_conv, true);
21527 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21528 LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(arg);
21529 int64_t ret_conv = CResult__u832APIErrorZ_clone_ptr(arg_conv);
21533 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21534 LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(orig);
21535 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
21536 *ret_conv = CResult__u832APIErrorZ_clone(orig_conv);
21537 return tag_ptr(ret_conv, true);
21540 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RecentPaymentDetailsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
21541 LDKCVec_RecentPaymentDetailsZ _res_constr;
21542 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
21543 if (_res_constr.datalen > 0)
21544 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRecentPaymentDetails), "LDKCVec_RecentPaymentDetailsZ Elements");
21546 _res_constr.data = NULL;
21547 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
21548 for (size_t w = 0; w < _res_constr.datalen; w++) {
21549 int64_t _res_conv_22 = _res_vals[w];
21550 void* _res_conv_22_ptr = untag_ptr(_res_conv_22);
21551 CHECK_ACCESS(_res_conv_22_ptr);
21552 LDKRecentPaymentDetails _res_conv_22_conv = *(LDKRecentPaymentDetails*)(_res_conv_22_ptr);
21553 FREE(untag_ptr(_res_conv_22));
21554 _res_constr.data[w] = _res_conv_22_conv;
21556 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
21557 CVec_RecentPaymentDetailsZ_free(_res_constr);
21560 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok(JNIEnv *env, jclass clz) {
21561 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
21562 *ret_conv = CResult_NonePaymentSendFailureZ_ok();
21563 return tag_ptr(ret_conv, true);
21566 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21567 void* e_ptr = untag_ptr(e);
21568 CHECK_ACCESS(e_ptr);
21569 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
21570 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
21571 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
21572 *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv);
21573 return tag_ptr(ret_conv, true);
21576 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21577 LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(o);
21578 jboolean ret_conv = CResult_NonePaymentSendFailureZ_is_ok(o_conv);
21582 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21583 if (!ptr_is_owned(_res)) return;
21584 void* _res_ptr = untag_ptr(_res);
21585 CHECK_ACCESS(_res_ptr);
21586 LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr);
21587 FREE(untag_ptr(_res));
21588 CResult_NonePaymentSendFailureZ_free(_res_conv);
21591 static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) {
21592 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
21593 *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg);
21594 return tag_ptr(ret_conv, true);
21596 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21597 LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(arg);
21598 int64_t ret_conv = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv);
21602 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21603 LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(orig);
21604 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
21605 *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv);
21606 return tag_ptr(ret_conv, true);
21609 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendFailureZ_1ok(JNIEnv *env, jclass clz) {
21610 LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ");
21611 *ret_conv = CResult_NoneRetryableSendFailureZ_ok();
21612 return tag_ptr(ret_conv, true);
21615 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendFailureZ_1err(JNIEnv *env, jclass clz, jclass e) {
21616 LDKRetryableSendFailure e_conv = LDKRetryableSendFailure_from_java(env, e);
21617 LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ");
21618 *ret_conv = CResult_NoneRetryableSendFailureZ_err(e_conv);
21619 return tag_ptr(ret_conv, true);
21622 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21623 LDKCResult_NoneRetryableSendFailureZ* o_conv = (LDKCResult_NoneRetryableSendFailureZ*)untag_ptr(o);
21624 jboolean ret_conv = CResult_NoneRetryableSendFailureZ_is_ok(o_conv);
21628 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21629 if (!ptr_is_owned(_res)) return;
21630 void* _res_ptr = untag_ptr(_res);
21631 CHECK_ACCESS(_res_ptr);
21632 LDKCResult_NoneRetryableSendFailureZ _res_conv = *(LDKCResult_NoneRetryableSendFailureZ*)(_res_ptr);
21633 FREE(untag_ptr(_res));
21634 CResult_NoneRetryableSendFailureZ_free(_res_conv);
21637 static inline uint64_t CResult_NoneRetryableSendFailureZ_clone_ptr(LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR arg) {
21638 LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ");
21639 *ret_conv = CResult_NoneRetryableSendFailureZ_clone(arg);
21640 return tag_ptr(ret_conv, true);
21642 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21643 LDKCResult_NoneRetryableSendFailureZ* arg_conv = (LDKCResult_NoneRetryableSendFailureZ*)untag_ptr(arg);
21644 int64_t ret_conv = CResult_NoneRetryableSendFailureZ_clone_ptr(arg_conv);
21648 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneRetryableSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21649 LDKCResult_NoneRetryableSendFailureZ* orig_conv = (LDKCResult_NoneRetryableSendFailureZ*)untag_ptr(orig);
21650 LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ");
21651 *ret_conv = CResult_NoneRetryableSendFailureZ_clone(orig_conv);
21652 return tag_ptr(ret_conv, true);
21655 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
21656 LDKThirtyTwoBytes o_ref;
21657 CHECK((*env)->GetArrayLength(env, o) == 32);
21658 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
21659 LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
21660 *ret_conv = CResult_PaymentHashPaymentSendFailureZ_ok(o_ref);
21661 return tag_ptr(ret_conv, true);
21664 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21665 void* e_ptr = untag_ptr(e);
21666 CHECK_ACCESS(e_ptr);
21667 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
21668 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
21669 LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
21670 *ret_conv = CResult_PaymentHashPaymentSendFailureZ_err(e_conv);
21671 return tag_ptr(ret_conv, true);
21674 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21675 LDKCResult_PaymentHashPaymentSendFailureZ* o_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(o);
21676 jboolean ret_conv = CResult_PaymentHashPaymentSendFailureZ_is_ok(o_conv);
21680 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21681 if (!ptr_is_owned(_res)) return;
21682 void* _res_ptr = untag_ptr(_res);
21683 CHECK_ACCESS(_res_ptr);
21684 LDKCResult_PaymentHashPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentHashPaymentSendFailureZ*)(_res_ptr);
21685 FREE(untag_ptr(_res));
21686 CResult_PaymentHashPaymentSendFailureZ_free(_res_conv);
21689 static inline uint64_t CResult_PaymentHashPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR arg) {
21690 LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
21691 *ret_conv = CResult_PaymentHashPaymentSendFailureZ_clone(arg);
21692 return tag_ptr(ret_conv, true);
21694 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21695 LDKCResult_PaymentHashPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(arg);
21696 int64_t ret_conv = CResult_PaymentHashPaymentSendFailureZ_clone_ptr(arg_conv);
21700 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21701 LDKCResult_PaymentHashPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(orig);
21702 LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
21703 *ret_conv = CResult_PaymentHashPaymentSendFailureZ_clone(orig_conv);
21704 return tag_ptr(ret_conv, true);
21707 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashRetryableSendFailureZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
21708 LDKThirtyTwoBytes o_ref;
21709 CHECK((*env)->GetArrayLength(env, o) == 32);
21710 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
21711 LDKCResult_PaymentHashRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashRetryableSendFailureZ), "LDKCResult_PaymentHashRetryableSendFailureZ");
21712 *ret_conv = CResult_PaymentHashRetryableSendFailureZ_ok(o_ref);
21713 return tag_ptr(ret_conv, true);
21716 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashRetryableSendFailureZ_1err(JNIEnv *env, jclass clz, jclass e) {
21717 LDKRetryableSendFailure e_conv = LDKRetryableSendFailure_from_java(env, e);
21718 LDKCResult_PaymentHashRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashRetryableSendFailureZ), "LDKCResult_PaymentHashRetryableSendFailureZ");
21719 *ret_conv = CResult_PaymentHashRetryableSendFailureZ_err(e_conv);
21720 return tag_ptr(ret_conv, true);
21723 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashRetryableSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21724 LDKCResult_PaymentHashRetryableSendFailureZ* o_conv = (LDKCResult_PaymentHashRetryableSendFailureZ*)untag_ptr(o);
21725 jboolean ret_conv = CResult_PaymentHashRetryableSendFailureZ_is_ok(o_conv);
21729 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashRetryableSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21730 if (!ptr_is_owned(_res)) return;
21731 void* _res_ptr = untag_ptr(_res);
21732 CHECK_ACCESS(_res_ptr);
21733 LDKCResult_PaymentHashRetryableSendFailureZ _res_conv = *(LDKCResult_PaymentHashRetryableSendFailureZ*)(_res_ptr);
21734 FREE(untag_ptr(_res));
21735 CResult_PaymentHashRetryableSendFailureZ_free(_res_conv);
21738 static inline uint64_t CResult_PaymentHashRetryableSendFailureZ_clone_ptr(LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR arg) {
21739 LDKCResult_PaymentHashRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashRetryableSendFailureZ), "LDKCResult_PaymentHashRetryableSendFailureZ");
21740 *ret_conv = CResult_PaymentHashRetryableSendFailureZ_clone(arg);
21741 return tag_ptr(ret_conv, true);
21743 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashRetryableSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21744 LDKCResult_PaymentHashRetryableSendFailureZ* arg_conv = (LDKCResult_PaymentHashRetryableSendFailureZ*)untag_ptr(arg);
21745 int64_t ret_conv = CResult_PaymentHashRetryableSendFailureZ_clone_ptr(arg_conv);
21749 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashRetryableSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21750 LDKCResult_PaymentHashRetryableSendFailureZ* orig_conv = (LDKCResult_PaymentHashRetryableSendFailureZ*)untag_ptr(orig);
21751 LDKCResult_PaymentHashRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashRetryableSendFailureZ), "LDKCResult_PaymentHashRetryableSendFailureZ");
21752 *ret_conv = CResult_PaymentHashRetryableSendFailureZ_clone(orig_conv);
21753 return tag_ptr(ret_conv, true);
21756 static inline uint64_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) {
21757 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
21758 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg);
21759 return tag_ptr(ret_conv, true);
21761 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21762 LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(arg);
21763 int64_t ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv);
21767 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21768 LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(orig);
21769 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
21770 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(orig_conv);
21771 return tag_ptr(ret_conv, true);
21774 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) {
21775 LDKThirtyTwoBytes a_ref;
21776 CHECK((*env)->GetArrayLength(env, a) == 32);
21777 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
21778 LDKThirtyTwoBytes b_ref;
21779 CHECK((*env)->GetArrayLength(env, b) == 32);
21780 (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
21781 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
21782 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_ref);
21783 return tag_ptr(ret_conv, true);
21786 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentIdZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21787 if (!ptr_is_owned(_res)) return;
21788 void* _res_ptr = untag_ptr(_res);
21789 CHECK_ACCESS(_res_ptr);
21790 LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(_res_ptr);
21791 FREE(untag_ptr(_res));
21792 C2Tuple_PaymentHashPaymentIdZ_free(_res_conv);
21795 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21796 void* o_ptr = untag_ptr(o);
21797 CHECK_ACCESS(o_ptr);
21798 LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(o_ptr);
21799 o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(o));
21800 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
21801 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o_conv);
21802 return tag_ptr(ret_conv, true);
21805 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21806 void* e_ptr = untag_ptr(e);
21807 CHECK_ACCESS(e_ptr);
21808 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
21809 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
21810 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
21811 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e_conv);
21812 return tag_ptr(ret_conv, true);
21815 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21816 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(o);
21817 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o_conv);
21821 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21822 if (!ptr_is_owned(_res)) return;
21823 void* _res_ptr = untag_ptr(_res);
21824 CHECK_ACCESS(_res_ptr);
21825 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(_res_ptr);
21826 FREE(untag_ptr(_res));
21827 CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv);
21830 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) {
21831 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
21832 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg);
21833 return tag_ptr(ret_conv, true);
21835 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21836 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(arg);
21837 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv);
21841 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentIdZPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21842 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(orig);
21843 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
21844 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(orig_conv);
21845 return tag_ptr(ret_conv, true);
21848 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ThirtyTwoBytesZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
21849 LDKCVec_ThirtyTwoBytesZ _res_constr;
21850 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
21851 if (_res_constr.datalen > 0)
21852 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements");
21854 _res_constr.data = NULL;
21855 for (size_t i = 0; i < _res_constr.datalen; i++) {
21856 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
21857 LDKThirtyTwoBytes _res_conv_8_ref;
21858 CHECK((*env)->GetArrayLength(env, _res_conv_8) == 32);
21859 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 32, _res_conv_8_ref.data);
21860 _res_constr.data[i] = _res_conv_8_ref;
21862 CVec_ThirtyTwoBytesZ_free(_res_constr);
21865 static inline uint64_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) {
21866 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
21867 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg);
21868 return tag_ptr(ret_conv, true);
21870 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21871 LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(arg);
21872 int64_t ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv);
21876 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21877 LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(orig);
21878 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
21879 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(orig_conv);
21880 return tag_ptr(ret_conv, true);
21883 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int8_tArray b) {
21884 LDKThirtyTwoBytes a_ref;
21885 CHECK((*env)->GetArrayLength(env, a) == 32);
21886 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
21887 LDKThirtyTwoBytes b_ref;
21888 CHECK((*env)->GetArrayLength(env, b) == 32);
21889 (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
21890 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
21891 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_new(a_ref, b_ref);
21892 return tag_ptr(ret_conv, true);
21895 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PaymentHashPaymentSecretZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21896 if (!ptr_is_owned(_res)) return;
21897 void* _res_ptr = untag_ptr(_res);
21898 CHECK_ACCESS(_res_ptr);
21899 LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(_res_ptr);
21900 FREE(untag_ptr(_res));
21901 C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv);
21904 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21905 void* o_ptr = untag_ptr(o);
21906 CHECK_ACCESS(o_ptr);
21907 LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
21908 o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(o));
21909 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
21910 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o_conv);
21911 return tag_ptr(ret_conv, true);
21914 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1err(JNIEnv *env, jclass clz) {
21915 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
21916 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err();
21917 return tag_ptr(ret_conv, true);
21920 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21921 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(o);
21922 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o_conv);
21926 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21927 if (!ptr_is_owned(_res)) return;
21928 void* _res_ptr = untag_ptr(_res);
21929 CHECK_ACCESS(_res_ptr);
21930 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(_res_ptr);
21931 FREE(untag_ptr(_res));
21932 CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res_conv);
21935 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg) {
21936 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
21937 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(arg);
21938 return tag_ptr(ret_conv, true);
21940 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21941 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(arg);
21942 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv);
21946 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
21947 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(orig);
21948 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
21949 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig_conv);
21950 return tag_ptr(ret_conv, true);
21953 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
21954 void* o_ptr = untag_ptr(o);
21955 CHECK_ACCESS(o_ptr);
21956 LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
21957 o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(o));
21958 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
21959 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o_conv);
21960 return tag_ptr(ret_conv, true);
21963 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
21964 void* e_ptr = untag_ptr(e);
21965 CHECK_ACCESS(e_ptr);
21966 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
21967 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
21968 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
21969 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e_conv);
21970 return tag_ptr(ret_conv, true);
21973 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
21974 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(o);
21975 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o_conv);
21979 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
21980 if (!ptr_is_owned(_res)) return;
21981 void* _res_ptr = untag_ptr(_res);
21982 CHECK_ACCESS(_res_ptr);
21983 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(_res_ptr);
21984 FREE(untag_ptr(_res));
21985 CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res_conv);
21988 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg) {
21989 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
21990 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(arg);
21991 return tag_ptr(ret_conv, true);
21993 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
21994 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(arg);
21995 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv);
21999 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1PaymentHashPaymentSecretZAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22000 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(orig);
22001 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
22002 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig_conv);
22003 return tag_ptr(ret_conv, true);
22006 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
22007 LDKThirtyTwoBytes o_ref;
22008 CHECK((*env)->GetArrayLength(env, o) == 32);
22009 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
22010 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
22011 *ret_conv = CResult_PaymentSecretNoneZ_ok(o_ref);
22012 return tag_ptr(ret_conv, true);
22015 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1err(JNIEnv *env, jclass clz) {
22016 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
22017 *ret_conv = CResult_PaymentSecretNoneZ_err();
22018 return tag_ptr(ret_conv, true);
22021 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22022 LDKCResult_PaymentSecretNoneZ* o_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(o);
22023 jboolean ret_conv = CResult_PaymentSecretNoneZ_is_ok(o_conv);
22027 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22028 if (!ptr_is_owned(_res)) return;
22029 void* _res_ptr = untag_ptr(_res);
22030 CHECK_ACCESS(_res_ptr);
22031 LDKCResult_PaymentSecretNoneZ _res_conv = *(LDKCResult_PaymentSecretNoneZ*)(_res_ptr);
22032 FREE(untag_ptr(_res));
22033 CResult_PaymentSecretNoneZ_free(_res_conv);
22036 static inline uint64_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg) {
22037 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
22038 *ret_conv = CResult_PaymentSecretNoneZ_clone(arg);
22039 return tag_ptr(ret_conv, true);
22041 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22042 LDKCResult_PaymentSecretNoneZ* arg_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(arg);
22043 int64_t ret_conv = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv);
22047 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22048 LDKCResult_PaymentSecretNoneZ* orig_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(orig);
22049 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
22050 *ret_conv = CResult_PaymentSecretNoneZ_clone(orig_conv);
22051 return tag_ptr(ret_conv, true);
22054 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
22055 LDKThirtyTwoBytes o_ref;
22056 CHECK((*env)->GetArrayLength(env, o) == 32);
22057 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
22058 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
22059 *ret_conv = CResult_PaymentSecretAPIErrorZ_ok(o_ref);
22060 return tag_ptr(ret_conv, true);
22063 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22064 void* e_ptr = untag_ptr(e);
22065 CHECK_ACCESS(e_ptr);
22066 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
22067 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
22068 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
22069 *ret_conv = CResult_PaymentSecretAPIErrorZ_err(e_conv);
22070 return tag_ptr(ret_conv, true);
22073 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22074 LDKCResult_PaymentSecretAPIErrorZ* o_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(o);
22075 jboolean ret_conv = CResult_PaymentSecretAPIErrorZ_is_ok(o_conv);
22079 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22080 if (!ptr_is_owned(_res)) return;
22081 void* _res_ptr = untag_ptr(_res);
22082 CHECK_ACCESS(_res_ptr);
22083 LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(_res_ptr);
22084 FREE(untag_ptr(_res));
22085 CResult_PaymentSecretAPIErrorZ_free(_res_conv);
22088 static inline uint64_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) {
22089 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
22090 *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg);
22091 return tag_ptr(ret_conv, true);
22093 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22094 LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(arg);
22095 int64_t ret_conv = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv);
22099 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentSecretAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22100 LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(orig);
22101 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
22102 *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(orig_conv);
22103 return tag_ptr(ret_conv, true);
22106 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
22107 LDKThirtyTwoBytes o_ref;
22108 CHECK((*env)->GetArrayLength(env, o) == 32);
22109 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
22110 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
22111 *ret_conv = CResult_PaymentPreimageAPIErrorZ_ok(o_ref);
22112 return tag_ptr(ret_conv, true);
22115 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22116 void* e_ptr = untag_ptr(e);
22117 CHECK_ACCESS(e_ptr);
22118 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
22119 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
22120 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
22121 *ret_conv = CResult_PaymentPreimageAPIErrorZ_err(e_conv);
22122 return tag_ptr(ret_conv, true);
22125 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22126 LDKCResult_PaymentPreimageAPIErrorZ* o_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(o);
22127 jboolean ret_conv = CResult_PaymentPreimageAPIErrorZ_is_ok(o_conv);
22131 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22132 if (!ptr_is_owned(_res)) return;
22133 void* _res_ptr = untag_ptr(_res);
22134 CHECK_ACCESS(_res_ptr);
22135 LDKCResult_PaymentPreimageAPIErrorZ _res_conv = *(LDKCResult_PaymentPreimageAPIErrorZ*)(_res_ptr);
22136 FREE(untag_ptr(_res));
22137 CResult_PaymentPreimageAPIErrorZ_free(_res_conv);
22140 static inline uint64_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg) {
22141 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
22142 *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(arg);
22143 return tag_ptr(ret_conv, true);
22145 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22146 LDKCResult_PaymentPreimageAPIErrorZ* arg_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(arg);
22147 int64_t ret_conv = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv);
22151 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPreimageAPIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22152 LDKCResult_PaymentPreimageAPIErrorZ* orig_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(orig);
22153 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
22154 *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(orig_conv);
22155 return tag_ptr(ret_conv, true);
22158 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22159 LDKCounterpartyForwardingInfo o_conv;
22160 o_conv.inner = untag_ptr(o);
22161 o_conv.is_owned = ptr_is_owned(o);
22162 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22163 o_conv = CounterpartyForwardingInfo_clone(&o_conv);
22164 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
22165 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o_conv);
22166 return tag_ptr(ret_conv, true);
22169 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22170 void* e_ptr = untag_ptr(e);
22171 CHECK_ACCESS(e_ptr);
22172 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22173 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22174 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
22175 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv);
22176 return tag_ptr(ret_conv, true);
22179 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22180 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* o_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(o);
22181 jboolean ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(o_conv);
22185 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22186 if (!ptr_is_owned(_res)) return;
22187 void* _res_ptr = untag_ptr(_res);
22188 CHECK_ACCESS(_res_ptr);
22189 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(_res_ptr);
22190 FREE(untag_ptr(_res));
22191 CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv);
22194 static inline uint64_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg) {
22195 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
22196 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(arg);
22197 return tag_ptr(ret_conv, true);
22199 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22200 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(arg);
22201 int64_t ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(arg_conv);
22205 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22206 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(orig);
22207 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
22208 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(orig_conv);
22209 return tag_ptr(ret_conv, true);
22212 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22213 LDKChannelCounterparty o_conv;
22214 o_conv.inner = untag_ptr(o);
22215 o_conv.is_owned = ptr_is_owned(o);
22216 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22217 o_conv = ChannelCounterparty_clone(&o_conv);
22218 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
22219 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv);
22220 return tag_ptr(ret_conv, true);
22223 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22224 void* e_ptr = untag_ptr(e);
22225 CHECK_ACCESS(e_ptr);
22226 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22227 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22228 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
22229 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv);
22230 return tag_ptr(ret_conv, true);
22233 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22234 LDKCResult_ChannelCounterpartyDecodeErrorZ* o_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(o);
22235 jboolean ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_is_ok(o_conv);
22239 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22240 if (!ptr_is_owned(_res)) return;
22241 void* _res_ptr = untag_ptr(_res);
22242 CHECK_ACCESS(_res_ptr);
22243 LDKCResult_ChannelCounterpartyDecodeErrorZ _res_conv = *(LDKCResult_ChannelCounterpartyDecodeErrorZ*)(_res_ptr);
22244 FREE(untag_ptr(_res));
22245 CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv);
22248 static inline uint64_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg) {
22249 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
22250 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(arg);
22251 return tag_ptr(ret_conv, true);
22253 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22254 LDKCResult_ChannelCounterpartyDecodeErrorZ* arg_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(arg);
22255 int64_t ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(arg_conv);
22259 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22260 LDKCResult_ChannelCounterpartyDecodeErrorZ* orig_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(orig);
22261 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
22262 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(orig_conv);
22263 return tag_ptr(ret_conv, true);
22266 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22267 LDKChannelDetails o_conv;
22268 o_conv.inner = untag_ptr(o);
22269 o_conv.is_owned = ptr_is_owned(o);
22270 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22271 o_conv = ChannelDetails_clone(&o_conv);
22272 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
22273 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_ok(o_conv);
22274 return tag_ptr(ret_conv, true);
22277 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22278 void* e_ptr = untag_ptr(e);
22279 CHECK_ACCESS(e_ptr);
22280 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22281 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22282 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
22283 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv);
22284 return tag_ptr(ret_conv, true);
22287 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22288 LDKCResult_ChannelDetailsDecodeErrorZ* o_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(o);
22289 jboolean ret_conv = CResult_ChannelDetailsDecodeErrorZ_is_ok(o_conv);
22293 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22294 if (!ptr_is_owned(_res)) return;
22295 void* _res_ptr = untag_ptr(_res);
22296 CHECK_ACCESS(_res_ptr);
22297 LDKCResult_ChannelDetailsDecodeErrorZ _res_conv = *(LDKCResult_ChannelDetailsDecodeErrorZ*)(_res_ptr);
22298 FREE(untag_ptr(_res));
22299 CResult_ChannelDetailsDecodeErrorZ_free(_res_conv);
22302 static inline uint64_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg) {
22303 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
22304 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(arg);
22305 return tag_ptr(ret_conv, true);
22307 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22308 LDKCResult_ChannelDetailsDecodeErrorZ* arg_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(arg);
22309 int64_t ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone_ptr(arg_conv);
22313 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22314 LDKCResult_ChannelDetailsDecodeErrorZ* orig_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(orig);
22315 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
22316 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(orig_conv);
22317 return tag_ptr(ret_conv, true);
22320 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22321 LDKPhantomRouteHints o_conv;
22322 o_conv.inner = untag_ptr(o);
22323 o_conv.is_owned = ptr_is_owned(o);
22324 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22325 o_conv = PhantomRouteHints_clone(&o_conv);
22326 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
22327 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_ok(o_conv);
22328 return tag_ptr(ret_conv, true);
22331 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22332 void* e_ptr = untag_ptr(e);
22333 CHECK_ACCESS(e_ptr);
22334 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22335 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22336 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
22337 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_err(e_conv);
22338 return tag_ptr(ret_conv, true);
22341 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22342 LDKCResult_PhantomRouteHintsDecodeErrorZ* o_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(o);
22343 jboolean ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_is_ok(o_conv);
22347 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22348 if (!ptr_is_owned(_res)) return;
22349 void* _res_ptr = untag_ptr(_res);
22350 CHECK_ACCESS(_res_ptr);
22351 LDKCResult_PhantomRouteHintsDecodeErrorZ _res_conv = *(LDKCResult_PhantomRouteHintsDecodeErrorZ*)(_res_ptr);
22352 FREE(untag_ptr(_res));
22353 CResult_PhantomRouteHintsDecodeErrorZ_free(_res_conv);
22356 static inline uint64_t CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR arg) {
22357 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
22358 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(arg);
22359 return tag_ptr(ret_conv, true);
22361 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22362 LDKCResult_PhantomRouteHintsDecodeErrorZ* arg_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(arg);
22363 int64_t ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(arg_conv);
22367 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22368 LDKCResult_PhantomRouteHintsDecodeErrorZ* orig_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(orig);
22369 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
22370 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(orig_conv);
22371 return tag_ptr(ret_conv, true);
22374 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
22375 LDKCVec_ChannelMonitorZ _res_constr;
22376 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
22377 if (_res_constr.datalen > 0)
22378 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
22380 _res_constr.data = NULL;
22381 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
22382 for (size_t q = 0; q < _res_constr.datalen; q++) {
22383 int64_t _res_conv_16 = _res_vals[q];
22384 LDKChannelMonitor _res_conv_16_conv;
22385 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
22386 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
22387 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
22388 _res_constr.data[q] = _res_conv_16_conv;
22390 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
22391 CVec_ChannelMonitorZ_free(_res_constr);
22394 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
22395 LDKThirtyTwoBytes a_ref;
22396 CHECK((*env)->GetArrayLength(env, a) == 32);
22397 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
22398 LDKChannelManager b_conv;
22399 b_conv.inner = untag_ptr(b);
22400 b_conv.is_owned = ptr_is_owned(b);
22401 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
22402 // WARNING: we need a move here but no clone is available for LDKChannelManager
22404 LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ");
22405 *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv);
22406 return tag_ptr(ret_conv, true);
22409 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22410 if (!ptr_is_owned(_res)) return;
22411 void* _res_ptr = untag_ptr(_res);
22412 CHECK_ACCESS(_res_ptr);
22413 LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(_res_ptr);
22414 FREE(untag_ptr(_res));
22415 C2Tuple_BlockHashChannelManagerZ_free(_res_conv);
22418 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22419 void* o_ptr = untag_ptr(o);
22420 CHECK_ACCESS(o_ptr);
22421 LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(o_ptr);
22422 // WARNING: we may need a move here but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ
22423 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
22424 *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv);
22425 return tag_ptr(ret_conv, true);
22428 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22429 void* e_ptr = untag_ptr(e);
22430 CHECK_ACCESS(e_ptr);
22431 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22432 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22433 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
22434 *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv);
22435 return tag_ptr(ret_conv, true);
22438 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22439 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(o);
22440 jboolean ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o_conv);
22444 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22445 if (!ptr_is_owned(_res)) return;
22446 void* _res_ptr = untag_ptr(_res);
22447 CHECK_ACCESS(_res_ptr);
22448 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(_res_ptr);
22449 FREE(untag_ptr(_res));
22450 CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv);
22453 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22454 LDKChannelConfig o_conv;
22455 o_conv.inner = untag_ptr(o);
22456 o_conv.is_owned = ptr_is_owned(o);
22457 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22458 o_conv = ChannelConfig_clone(&o_conv);
22459 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
22460 *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv);
22461 return tag_ptr(ret_conv, true);
22464 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22465 void* e_ptr = untag_ptr(e);
22466 CHECK_ACCESS(e_ptr);
22467 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22468 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22469 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
22470 *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv);
22471 return tag_ptr(ret_conv, true);
22474 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22475 LDKCResult_ChannelConfigDecodeErrorZ* o_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(o);
22476 jboolean ret_conv = CResult_ChannelConfigDecodeErrorZ_is_ok(o_conv);
22480 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22481 if (!ptr_is_owned(_res)) return;
22482 void* _res_ptr = untag_ptr(_res);
22483 CHECK_ACCESS(_res_ptr);
22484 LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(_res_ptr);
22485 FREE(untag_ptr(_res));
22486 CResult_ChannelConfigDecodeErrorZ_free(_res_conv);
22489 static inline uint64_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) {
22490 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
22491 *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg);
22492 return tag_ptr(ret_conv, true);
22494 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22495 LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(arg);
22496 int64_t ret_conv = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv);
22500 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22501 LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(orig);
22502 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
22503 *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(orig_conv);
22504 return tag_ptr(ret_conv, true);
22507 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1APIErrorZ_1some(JNIEnv *env, jclass clz, int64_t o) {
22508 void* o_ptr = untag_ptr(o);
22509 CHECK_ACCESS(o_ptr);
22510 LDKAPIError o_conv = *(LDKAPIError*)(o_ptr);
22511 o_conv = APIError_clone((LDKAPIError*)untag_ptr(o));
22512 LDKCOption_APIErrorZ *ret_copy = MALLOC(sizeof(LDKCOption_APIErrorZ), "LDKCOption_APIErrorZ");
22513 *ret_copy = COption_APIErrorZ_some(o_conv);
22514 int64_t ret_ref = tag_ptr(ret_copy, true);
22518 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1APIErrorZ_1none(JNIEnv *env, jclass clz) {
22519 LDKCOption_APIErrorZ *ret_copy = MALLOC(sizeof(LDKCOption_APIErrorZ), "LDKCOption_APIErrorZ");
22520 *ret_copy = COption_APIErrorZ_none();
22521 int64_t ret_ref = tag_ptr(ret_copy, true);
22525 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1APIErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22526 if (!ptr_is_owned(_res)) return;
22527 void* _res_ptr = untag_ptr(_res);
22528 CHECK_ACCESS(_res_ptr);
22529 LDKCOption_APIErrorZ _res_conv = *(LDKCOption_APIErrorZ*)(_res_ptr);
22530 FREE(untag_ptr(_res));
22531 COption_APIErrorZ_free(_res_conv);
22534 static inline uint64_t COption_APIErrorZ_clone_ptr(LDKCOption_APIErrorZ *NONNULL_PTR arg) {
22535 LDKCOption_APIErrorZ *ret_copy = MALLOC(sizeof(LDKCOption_APIErrorZ), "LDKCOption_APIErrorZ");
22536 *ret_copy = COption_APIErrorZ_clone(arg);
22537 int64_t ret_ref = tag_ptr(ret_copy, true);
22540 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1APIErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22541 LDKCOption_APIErrorZ* arg_conv = (LDKCOption_APIErrorZ*)untag_ptr(arg);
22542 int64_t ret_conv = COption_APIErrorZ_clone_ptr(arg_conv);
22546 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1APIErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22547 LDKCOption_APIErrorZ* orig_conv = (LDKCOption_APIErrorZ*)untag_ptr(orig);
22548 LDKCOption_APIErrorZ *ret_copy = MALLOC(sizeof(LDKCOption_APIErrorZ), "LDKCOption_APIErrorZ");
22549 *ret_copy = COption_APIErrorZ_clone(orig_conv);
22550 int64_t ret_ref = tag_ptr(ret_copy, true);
22554 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1APIErrorZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22555 void* o_ptr = untag_ptr(o);
22556 CHECK_ACCESS(o_ptr);
22557 LDKCOption_APIErrorZ o_conv = *(LDKCOption_APIErrorZ*)(o_ptr);
22558 o_conv = COption_APIErrorZ_clone((LDKCOption_APIErrorZ*)untag_ptr(o));
22559 LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ");
22560 *ret_conv = CResult_COption_APIErrorZDecodeErrorZ_ok(o_conv);
22561 return tag_ptr(ret_conv, true);
22564 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1APIErrorZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22565 void* e_ptr = untag_ptr(e);
22566 CHECK_ACCESS(e_ptr);
22567 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22568 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22569 LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ");
22570 *ret_conv = CResult_COption_APIErrorZDecodeErrorZ_err(e_conv);
22571 return tag_ptr(ret_conv, true);
22574 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1APIErrorZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22575 LDKCResult_COption_APIErrorZDecodeErrorZ* o_conv = (LDKCResult_COption_APIErrorZDecodeErrorZ*)untag_ptr(o);
22576 jboolean ret_conv = CResult_COption_APIErrorZDecodeErrorZ_is_ok(o_conv);
22580 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1APIErrorZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22581 if (!ptr_is_owned(_res)) return;
22582 void* _res_ptr = untag_ptr(_res);
22583 CHECK_ACCESS(_res_ptr);
22584 LDKCResult_COption_APIErrorZDecodeErrorZ _res_conv = *(LDKCResult_COption_APIErrorZDecodeErrorZ*)(_res_ptr);
22585 FREE(untag_ptr(_res));
22586 CResult_COption_APIErrorZDecodeErrorZ_free(_res_conv);
22589 static inline uint64_t CResult_COption_APIErrorZDecodeErrorZ_clone_ptr(LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR arg) {
22590 LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ");
22591 *ret_conv = CResult_COption_APIErrorZDecodeErrorZ_clone(arg);
22592 return tag_ptr(ret_conv, true);
22594 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1APIErrorZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22595 LDKCResult_COption_APIErrorZDecodeErrorZ* arg_conv = (LDKCResult_COption_APIErrorZDecodeErrorZ*)untag_ptr(arg);
22596 int64_t ret_conv = CResult_COption_APIErrorZDecodeErrorZ_clone_ptr(arg_conv);
22600 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1APIErrorZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22601 LDKCResult_COption_APIErrorZDecodeErrorZ* orig_conv = (LDKCResult_COption_APIErrorZDecodeErrorZ*)untag_ptr(orig);
22602 LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ");
22603 *ret_conv = CResult_COption_APIErrorZDecodeErrorZ_clone(orig_conv);
22604 return tag_ptr(ret_conv, true);
22607 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22608 LDKUntrustedString o_conv;
22609 o_conv.inner = untag_ptr(o);
22610 o_conv.is_owned = ptr_is_owned(o);
22611 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22612 o_conv = UntrustedString_clone(&o_conv);
22613 LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ");
22614 *ret_conv = CResult_UntrustedStringDecodeErrorZ_ok(o_conv);
22615 return tag_ptr(ret_conv, true);
22618 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22619 void* e_ptr = untag_ptr(e);
22620 CHECK_ACCESS(e_ptr);
22621 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22622 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22623 LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ");
22624 *ret_conv = CResult_UntrustedStringDecodeErrorZ_err(e_conv);
22625 return tag_ptr(ret_conv, true);
22628 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22629 LDKCResult_UntrustedStringDecodeErrorZ* o_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(o);
22630 jboolean ret_conv = CResult_UntrustedStringDecodeErrorZ_is_ok(o_conv);
22634 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22635 if (!ptr_is_owned(_res)) return;
22636 void* _res_ptr = untag_ptr(_res);
22637 CHECK_ACCESS(_res_ptr);
22638 LDKCResult_UntrustedStringDecodeErrorZ _res_conv = *(LDKCResult_UntrustedStringDecodeErrorZ*)(_res_ptr);
22639 FREE(untag_ptr(_res));
22640 CResult_UntrustedStringDecodeErrorZ_free(_res_conv);
22643 static inline uint64_t CResult_UntrustedStringDecodeErrorZ_clone_ptr(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR arg) {
22644 LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ");
22645 *ret_conv = CResult_UntrustedStringDecodeErrorZ_clone(arg);
22646 return tag_ptr(ret_conv, true);
22648 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22649 LDKCResult_UntrustedStringDecodeErrorZ* arg_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(arg);
22650 int64_t ret_conv = CResult_UntrustedStringDecodeErrorZ_clone_ptr(arg_conv);
22654 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UntrustedStringDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22655 LDKCResult_UntrustedStringDecodeErrorZ* orig_conv = (LDKCResult_UntrustedStringDecodeErrorZ*)untag_ptr(orig);
22656 LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ");
22657 *ret_conv = CResult_UntrustedStringDecodeErrorZ_clone(orig_conv);
22658 return tag_ptr(ret_conv, true);
22661 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22662 LDKOutPoint o_conv;
22663 o_conv.inner = untag_ptr(o);
22664 o_conv.is_owned = ptr_is_owned(o);
22665 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22666 o_conv = OutPoint_clone(&o_conv);
22667 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
22668 *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv);
22669 return tag_ptr(ret_conv, true);
22672 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22673 void* e_ptr = untag_ptr(e);
22674 CHECK_ACCESS(e_ptr);
22675 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22676 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22677 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
22678 *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv);
22679 return tag_ptr(ret_conv, true);
22682 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22683 LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(o);
22684 jboolean ret_conv = CResult_OutPointDecodeErrorZ_is_ok(o_conv);
22688 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22689 if (!ptr_is_owned(_res)) return;
22690 void* _res_ptr = untag_ptr(_res);
22691 CHECK_ACCESS(_res_ptr);
22692 LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr);
22693 FREE(untag_ptr(_res));
22694 CResult_OutPointDecodeErrorZ_free(_res_conv);
22697 static inline uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) {
22698 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
22699 *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg);
22700 return tag_ptr(ret_conv, true);
22702 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22703 LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(arg);
22704 int64_t ret_conv = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv);
22708 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22709 LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(orig);
22710 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
22711 *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv);
22712 return tag_ptr(ret_conv, true);
22715 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1some(JNIEnv *env, jclass clz, int64_t o) {
22716 void* o_ptr = untag_ptr(o);
22717 CHECK_ACCESS(o_ptr);
22718 LDKType o_conv = *(LDKType*)(o_ptr);
22719 if (o_conv.free == LDKType_JCalls_free) {
22720 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22721 LDKType_JCalls_cloned(&o_conv);
22723 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
22724 *ret_copy = COption_TypeZ_some(o_conv);
22725 int64_t ret_ref = tag_ptr(ret_copy, true);
22729 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1none(JNIEnv *env, jclass clz) {
22730 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
22731 *ret_copy = COption_TypeZ_none();
22732 int64_t ret_ref = tag_ptr(ret_copy, true);
22736 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_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 LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(_res_ptr);
22741 FREE(untag_ptr(_res));
22742 COption_TypeZ_free(_res_conv);
22745 static inline uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) {
22746 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
22747 *ret_copy = COption_TypeZ_clone(arg);
22748 int64_t ret_ref = tag_ptr(ret_copy, true);
22751 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22752 LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)untag_ptr(arg);
22753 int64_t ret_conv = COption_TypeZ_clone_ptr(arg_conv);
22757 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1TypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22758 LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)untag_ptr(orig);
22759 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
22760 *ret_copy = COption_TypeZ_clone(orig_conv);
22761 int64_t ret_ref = tag_ptr(ret_copy, true);
22765 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22766 void* o_ptr = untag_ptr(o);
22767 CHECK_ACCESS(o_ptr);
22768 LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(o_ptr);
22769 o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)untag_ptr(o));
22770 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
22771 *ret_conv = CResult_COption_TypeZDecodeErrorZ_ok(o_conv);
22772 return tag_ptr(ret_conv, true);
22775 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22776 void* e_ptr = untag_ptr(e);
22777 CHECK_ACCESS(e_ptr);
22778 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22779 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22780 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
22781 *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv);
22782 return tag_ptr(ret_conv, true);
22785 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22786 LDKCResult_COption_TypeZDecodeErrorZ* o_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(o);
22787 jboolean ret_conv = CResult_COption_TypeZDecodeErrorZ_is_ok(o_conv);
22791 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22792 if (!ptr_is_owned(_res)) return;
22793 void* _res_ptr = untag_ptr(_res);
22794 CHECK_ACCESS(_res_ptr);
22795 LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(_res_ptr);
22796 FREE(untag_ptr(_res));
22797 CResult_COption_TypeZDecodeErrorZ_free(_res_conv);
22800 static inline uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) {
22801 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
22802 *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg);
22803 return tag_ptr(ret_conv, true);
22805 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22806 LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(arg);
22807 int64_t ret_conv = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv);
22811 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22812 LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(orig);
22813 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
22814 *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(orig_conv);
22815 return tag_ptr(ret_conv, true);
22818 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
22819 LDKThirtyTwoBytes o_ref;
22820 CHECK((*env)->GetArrayLength(env, o) == 32);
22821 (*env)->GetByteArrayRegion(env, o, 0, 32, o_ref.data);
22822 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
22823 *ret_conv = CResult_PaymentIdPaymentErrorZ_ok(o_ref);
22824 return tag_ptr(ret_conv, true);
22827 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22828 void* e_ptr = untag_ptr(e);
22829 CHECK_ACCESS(e_ptr);
22830 LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr);
22831 e_conv = PaymentError_clone((LDKPaymentError*)untag_ptr(e));
22832 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
22833 *ret_conv = CResult_PaymentIdPaymentErrorZ_err(e_conv);
22834 return tag_ptr(ret_conv, true);
22837 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22838 LDKCResult_PaymentIdPaymentErrorZ* o_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(o);
22839 jboolean ret_conv = CResult_PaymentIdPaymentErrorZ_is_ok(o_conv);
22843 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22844 if (!ptr_is_owned(_res)) return;
22845 void* _res_ptr = untag_ptr(_res);
22846 CHECK_ACCESS(_res_ptr);
22847 LDKCResult_PaymentIdPaymentErrorZ _res_conv = *(LDKCResult_PaymentIdPaymentErrorZ*)(_res_ptr);
22848 FREE(untag_ptr(_res));
22849 CResult_PaymentIdPaymentErrorZ_free(_res_conv);
22852 static inline uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg) {
22853 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
22854 *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(arg);
22855 return tag_ptr(ret_conv, true);
22857 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22858 LDKCResult_PaymentIdPaymentErrorZ* arg_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(arg);
22859 int64_t ret_conv = CResult_PaymentIdPaymentErrorZ_clone_ptr(arg_conv);
22863 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22864 LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(orig);
22865 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
22866 *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(orig_conv);
22867 return tag_ptr(ret_conv, true);
22870 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1ok(JNIEnv *env, jclass clz) {
22871 LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ");
22872 *ret_conv = CResult_NonePaymentErrorZ_ok();
22873 return tag_ptr(ret_conv, true);
22876 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22877 void* e_ptr = untag_ptr(e);
22878 CHECK_ACCESS(e_ptr);
22879 LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr);
22880 e_conv = PaymentError_clone((LDKPaymentError*)untag_ptr(e));
22881 LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ");
22882 *ret_conv = CResult_NonePaymentErrorZ_err(e_conv);
22883 return tag_ptr(ret_conv, true);
22886 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22887 LDKCResult_NonePaymentErrorZ* o_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(o);
22888 jboolean ret_conv = CResult_NonePaymentErrorZ_is_ok(o_conv);
22892 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22893 if (!ptr_is_owned(_res)) return;
22894 void* _res_ptr = untag_ptr(_res);
22895 CHECK_ACCESS(_res_ptr);
22896 LDKCResult_NonePaymentErrorZ _res_conv = *(LDKCResult_NonePaymentErrorZ*)(_res_ptr);
22897 FREE(untag_ptr(_res));
22898 CResult_NonePaymentErrorZ_free(_res_conv);
22901 static inline uint64_t CResult_NonePaymentErrorZ_clone_ptr(LDKCResult_NonePaymentErrorZ *NONNULL_PTR arg) {
22902 LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ");
22903 *ret_conv = CResult_NonePaymentErrorZ_clone(arg);
22904 return tag_ptr(ret_conv, true);
22906 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22907 LDKCResult_NonePaymentErrorZ* arg_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(arg);
22908 int64_t ret_conv = CResult_NonePaymentErrorZ_clone_ptr(arg_conv);
22912 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22913 LDKCResult_NonePaymentErrorZ* orig_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(orig);
22914 LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ");
22915 *ret_conv = CResult_NonePaymentErrorZ_clone(orig_conv);
22916 return tag_ptr(ret_conv, true);
22919 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1ok(JNIEnv *env, jclass clz, jstring o) {
22920 LDKStr o_conv = java_to_owned_str(env, o);
22921 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
22922 *ret_conv = CResult_StringErrorZ_ok(o_conv);
22923 return tag_ptr(ret_conv, true);
22926 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
22927 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
22928 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
22929 *ret_conv = CResult_StringErrorZ_err(e_conv);
22930 return tag_ptr(ret_conv, true);
22933 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22934 LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)untag_ptr(o);
22935 jboolean ret_conv = CResult_StringErrorZ_is_ok(o_conv);
22939 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22940 if (!ptr_is_owned(_res)) return;
22941 void* _res_ptr = untag_ptr(_res);
22942 CHECK_ACCESS(_res_ptr);
22943 LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr);
22944 FREE(untag_ptr(_res));
22945 CResult_StringErrorZ_free(_res_conv);
22948 static inline uint64_t CResult_StringErrorZ_clone_ptr(LDKCResult_StringErrorZ *NONNULL_PTR arg) {
22949 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
22950 *ret_conv = CResult_StringErrorZ_clone(arg);
22951 return tag_ptr(ret_conv, true);
22953 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
22954 LDKCResult_StringErrorZ* arg_conv = (LDKCResult_StringErrorZ*)untag_ptr(arg);
22955 int64_t ret_conv = CResult_StringErrorZ_clone_ptr(arg_conv);
22959 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
22960 LDKCResult_StringErrorZ* orig_conv = (LDKCResult_StringErrorZ*)untag_ptr(orig);
22961 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
22962 *ret_conv = CResult_StringErrorZ_clone(orig_conv);
22963 return tag_ptr(ret_conv, true);
22966 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
22967 LDKChannelMonitorUpdate o_conv;
22968 o_conv.inner = untag_ptr(o);
22969 o_conv.is_owned = ptr_is_owned(o);
22970 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22971 o_conv = ChannelMonitorUpdate_clone(&o_conv);
22972 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
22973 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv);
22974 return tag_ptr(ret_conv, true);
22977 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
22978 void* e_ptr = untag_ptr(e);
22979 CHECK_ACCESS(e_ptr);
22980 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
22981 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
22982 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
22983 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv);
22984 return tag_ptr(ret_conv, true);
22987 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
22988 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(o);
22989 jboolean ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv);
22993 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
22994 if (!ptr_is_owned(_res)) return;
22995 void* _res_ptr = untag_ptr(_res);
22996 CHECK_ACCESS(_res_ptr);
22997 LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr);
22998 FREE(untag_ptr(_res));
22999 CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv);
23002 static inline uint64_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) {
23003 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
23004 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg);
23005 return tag_ptr(ret_conv, true);
23007 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23008 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(arg);
23009 int64_t ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv);
23013 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23014 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(orig);
23015 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
23016 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig_conv);
23017 return tag_ptr(ret_conv, true);
23020 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1some(JNIEnv *env, jclass clz, int64_t o) {
23021 void* o_ptr = untag_ptr(o);
23022 CHECK_ACCESS(o_ptr);
23023 LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr);
23024 o_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(o));
23025 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
23026 *ret_copy = COption_MonitorEventZ_some(o_conv);
23027 int64_t ret_ref = tag_ptr(ret_copy, true);
23031 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1none(JNIEnv *env, jclass clz) {
23032 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
23033 *ret_copy = COption_MonitorEventZ_none();
23034 int64_t ret_ref = tag_ptr(ret_copy, true);
23038 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23039 if (!ptr_is_owned(_res)) return;
23040 void* _res_ptr = untag_ptr(_res);
23041 CHECK_ACCESS(_res_ptr);
23042 LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr);
23043 FREE(untag_ptr(_res));
23044 COption_MonitorEventZ_free(_res_conv);
23047 static inline uint64_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) {
23048 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
23049 *ret_copy = COption_MonitorEventZ_clone(arg);
23050 int64_t ret_ref = tag_ptr(ret_copy, true);
23053 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23054 LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)untag_ptr(arg);
23055 int64_t ret_conv = COption_MonitorEventZ_clone_ptr(arg_conv);
23059 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23060 LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)untag_ptr(orig);
23061 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
23062 *ret_copy = COption_MonitorEventZ_clone(orig_conv);
23063 int64_t ret_ref = tag_ptr(ret_copy, true);
23067 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23068 void* o_ptr = untag_ptr(o);
23069 CHECK_ACCESS(o_ptr);
23070 LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr);
23071 o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)untag_ptr(o));
23072 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
23073 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv);
23074 return tag_ptr(ret_conv, true);
23077 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23078 void* e_ptr = untag_ptr(e);
23079 CHECK_ACCESS(e_ptr);
23080 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23081 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23082 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
23083 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv);
23084 return tag_ptr(ret_conv, true);
23087 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23088 LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(o);
23089 jboolean ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv);
23093 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23094 if (!ptr_is_owned(_res)) return;
23095 void* _res_ptr = untag_ptr(_res);
23096 CHECK_ACCESS(_res_ptr);
23097 LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr);
23098 FREE(untag_ptr(_res));
23099 CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv);
23102 static inline uint64_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) {
23103 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
23104 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg);
23105 return tag_ptr(ret_conv, true);
23107 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23108 LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(arg);
23109 int64_t ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv);
23113 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23114 LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(orig);
23115 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
23116 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv);
23117 return tag_ptr(ret_conv, true);
23120 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23121 LDKHTLCUpdate o_conv;
23122 o_conv.inner = untag_ptr(o);
23123 o_conv.is_owned = ptr_is_owned(o);
23124 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23125 o_conv = HTLCUpdate_clone(&o_conv);
23126 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
23127 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv);
23128 return tag_ptr(ret_conv, true);
23131 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23132 void* e_ptr = untag_ptr(e);
23133 CHECK_ACCESS(e_ptr);
23134 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23135 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23136 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
23137 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv);
23138 return tag_ptr(ret_conv, true);
23141 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23142 LDKCResult_HTLCUpdateDecodeErrorZ* o_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(o);
23143 jboolean ret_conv = CResult_HTLCUpdateDecodeErrorZ_is_ok(o_conv);
23147 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23148 if (!ptr_is_owned(_res)) return;
23149 void* _res_ptr = untag_ptr(_res);
23150 CHECK_ACCESS(_res_ptr);
23151 LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(_res_ptr);
23152 FREE(untag_ptr(_res));
23153 CResult_HTLCUpdateDecodeErrorZ_free(_res_conv);
23156 static inline uint64_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) {
23157 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
23158 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg);
23159 return tag_ptr(ret_conv, true);
23161 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23162 LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(arg);
23163 int64_t ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv);
23167 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23168 LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(orig);
23169 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
23170 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(orig_conv);
23171 return tag_ptr(ret_conv, true);
23174 static inline uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) {
23175 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
23176 *ret_conv = C2Tuple_OutPointScriptZ_clone(arg);
23177 return tag_ptr(ret_conv, true);
23179 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23180 LDKC2Tuple_OutPointScriptZ* arg_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(arg);
23181 int64_t ret_conv = C2Tuple_OutPointScriptZ_clone_ptr(arg_conv);
23185 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23186 LDKC2Tuple_OutPointScriptZ* orig_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(orig);
23187 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
23188 *ret_conv = C2Tuple_OutPointScriptZ_clone(orig_conv);
23189 return tag_ptr(ret_conv, true);
23192 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) {
23193 LDKOutPoint a_conv;
23194 a_conv.inner = untag_ptr(a);
23195 a_conv.is_owned = ptr_is_owned(a);
23196 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23197 a_conv = OutPoint_clone(&a_conv);
23199 b_ref.datalen = (*env)->GetArrayLength(env, b);
23200 b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
23201 (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data);
23202 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
23203 *ret_conv = C2Tuple_OutPointScriptZ_new(a_conv, b_ref);
23204 return tag_ptr(ret_conv, true);
23207 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23208 if (!ptr_is_owned(_res)) return;
23209 void* _res_ptr = untag_ptr(_res);
23210 CHECK_ACCESS(_res_ptr);
23211 LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(_res_ptr);
23212 FREE(untag_ptr(_res));
23213 C2Tuple_OutPointScriptZ_free(_res_conv);
23216 static inline uint64_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg) {
23217 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
23218 *ret_conv = C2Tuple_u32ScriptZ_clone(arg);
23219 return tag_ptr(ret_conv, true);
23221 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23222 LDKC2Tuple_u32ScriptZ* arg_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(arg);
23223 int64_t ret_conv = C2Tuple_u32ScriptZ_clone_ptr(arg_conv);
23227 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23228 LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(orig);
23229 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
23230 *ret_conv = C2Tuple_u32ScriptZ_clone(orig_conv);
23231 return tag_ptr(ret_conv, true);
23234 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1new(JNIEnv *env, jclass clz, int32_t a, int8_tArray b) {
23236 b_ref.datalen = (*env)->GetArrayLength(env, b);
23237 b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
23238 (*env)->GetByteArrayRegion(env, b, 0, b_ref.datalen, b_ref.data);
23239 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
23240 *ret_conv = C2Tuple_u32ScriptZ_new(a, b_ref);
23241 return tag_ptr(ret_conv, true);
23244 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23245 if (!ptr_is_owned(_res)) return;
23246 void* _res_ptr = untag_ptr(_res);
23247 CHECK_ACCESS(_res_ptr);
23248 LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_ptr);
23249 FREE(untag_ptr(_res));
23250 C2Tuple_u32ScriptZ_free(_res_conv);
23253 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32ScriptZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
23254 LDKCVec_C2Tuple_u32ScriptZZ _res_constr;
23255 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
23256 if (_res_constr.datalen > 0)
23257 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
23259 _res_constr.data = NULL;
23260 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
23261 for (size_t v = 0; v < _res_constr.datalen; v++) {
23262 int64_t _res_conv_21 = _res_vals[v];
23263 void* _res_conv_21_ptr = untag_ptr(_res_conv_21);
23264 CHECK_ACCESS(_res_conv_21_ptr);
23265 LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_conv_21_ptr);
23266 FREE(untag_ptr(_res_conv_21));
23267 _res_constr.data[v] = _res_conv_21_conv;
23269 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
23270 CVec_C2Tuple_u32ScriptZZ_free(_res_constr);
23273 static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg) {
23274 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
23275 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(arg);
23276 return tag_ptr(ret_conv, true);
23278 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23279 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(arg);
23280 int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg_conv);
23284 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23285 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(orig);
23286 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
23287 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(orig_conv);
23288 return tag_ptr(ret_conv, true);
23291 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) {
23292 LDKThirtyTwoBytes a_ref;
23293 CHECK((*env)->GetArrayLength(env, a) == 32);
23294 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
23295 LDKCVec_C2Tuple_u32ScriptZZ b_constr;
23296 b_constr.datalen = (*env)->GetArrayLength(env, b);
23297 if (b_constr.datalen > 0)
23298 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
23300 b_constr.data = NULL;
23301 int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
23302 for (size_t v = 0; v < b_constr.datalen; v++) {
23303 int64_t b_conv_21 = b_vals[v];
23304 void* b_conv_21_ptr = untag_ptr(b_conv_21);
23305 CHECK_ACCESS(b_conv_21_ptr);
23306 LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(b_conv_21_ptr);
23307 b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)untag_ptr(b_conv_21));
23308 b_constr.data[v] = b_conv_21_conv;
23310 (*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
23311 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
23312 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a_ref, b_constr);
23313 return tag_ptr(ret_conv, true);
23316 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23317 if (!ptr_is_owned(_res)) return;
23318 void* _res_ptr = untag_ptr(_res);
23319 CHECK_ACCESS(_res_ptr);
23320 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_ptr);
23321 FREE(untag_ptr(_res));
23322 C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res_conv);
23325 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
23326 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res_constr;
23327 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
23328 if (_res_constr.datalen > 0)
23329 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Elements");
23331 _res_constr.data = NULL;
23332 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
23333 for (size_t o = 0; o < _res_constr.datalen; o++) {
23334 int64_t _res_conv_40 = _res_vals[o];
23335 void* _res_conv_40_ptr = untag_ptr(_res_conv_40);
23336 CHECK_ACCESS(_res_conv_40_ptr);
23337 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_conv_40_ptr);
23338 FREE(untag_ptr(_res_conv_40));
23339 _res_constr.data[o] = _res_conv_40_conv;
23341 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
23342 CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res_constr);
23345 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
23346 LDKCVec_EventZ _res_constr;
23347 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
23348 if (_res_constr.datalen > 0)
23349 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements");
23351 _res_constr.data = NULL;
23352 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
23353 for (size_t h = 0; h < _res_constr.datalen; h++) {
23354 int64_t _res_conv_7 = _res_vals[h];
23355 void* _res_conv_7_ptr = untag_ptr(_res_conv_7);
23356 CHECK_ACCESS(_res_conv_7_ptr);
23357 LDKEvent _res_conv_7_conv = *(LDKEvent*)(_res_conv_7_ptr);
23358 FREE(untag_ptr(_res_conv_7));
23359 _res_constr.data[h] = _res_conv_7_conv;
23361 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
23362 CVec_EventZ_free(_res_constr);
23365 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
23366 LDKCVec_TransactionZ _res_constr;
23367 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
23368 if (_res_constr.datalen > 0)
23369 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements");
23371 _res_constr.data = NULL;
23372 for (size_t i = 0; i < _res_constr.datalen; i++) {
23373 int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
23374 LDKTransaction _res_conv_8_ref;
23375 _res_conv_8_ref.datalen = (*env)->GetArrayLength(env, _res_conv_8);
23376 _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKTransaction Bytes");
23377 (*env)->GetByteArrayRegion(env, _res_conv_8, 0, _res_conv_8_ref.datalen, _res_conv_8_ref.data);
23378 _res_conv_8_ref.data_is_owned = true;
23379 _res_constr.data[i] = _res_conv_8_ref;
23381 CVec_TransactionZ_free(_res_constr);
23384 static inline uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) {
23385 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
23386 *ret_conv = C2Tuple_u32TxOutZ_clone(arg);
23387 return tag_ptr(ret_conv, true);
23389 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23390 LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(arg);
23391 int64_t ret_conv = C2Tuple_u32TxOutZ_clone_ptr(arg_conv);
23395 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23396 LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(orig);
23397 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
23398 *ret_conv = C2Tuple_u32TxOutZ_clone(orig_conv);
23399 return tag_ptr(ret_conv, true);
23402 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1new(JNIEnv *env, jclass clz, int32_t a, int64_t b) {
23403 void* b_ptr = untag_ptr(b);
23404 CHECK_ACCESS(b_ptr);
23405 LDKTxOut b_conv = *(LDKTxOut*)(b_ptr);
23406 b_conv = TxOut_clone((LDKTxOut*)untag_ptr(b));
23407 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
23408 *ret_conv = C2Tuple_u32TxOutZ_new(a, b_conv);
23409 return tag_ptr(ret_conv, true);
23412 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23413 if (!ptr_is_owned(_res)) return;
23414 void* _res_ptr = untag_ptr(_res);
23415 CHECK_ACCESS(_res_ptr);
23416 LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_ptr);
23417 FREE(untag_ptr(_res));
23418 C2Tuple_u32TxOutZ_free(_res_conv);
23421 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32TxOutZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
23422 LDKCVec_C2Tuple_u32TxOutZZ _res_constr;
23423 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
23424 if (_res_constr.datalen > 0)
23425 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
23427 _res_constr.data = NULL;
23428 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
23429 for (size_t u = 0; u < _res_constr.datalen; u++) {
23430 int64_t _res_conv_20 = _res_vals[u];
23431 void* _res_conv_20_ptr = untag_ptr(_res_conv_20);
23432 CHECK_ACCESS(_res_conv_20_ptr);
23433 LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_conv_20_ptr);
23434 FREE(untag_ptr(_res_conv_20));
23435 _res_constr.data[u] = _res_conv_20_conv;
23437 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
23438 CVec_C2Tuple_u32TxOutZZ_free(_res_constr);
23441 static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) {
23442 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
23443 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg);
23444 return tag_ptr(ret_conv, true);
23446 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23447 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(arg);
23448 int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv);
23452 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23453 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(orig);
23454 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
23455 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(orig_conv);
23456 return tag_ptr(ret_conv, true);
23459 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_tArray b) {
23460 LDKThirtyTwoBytes a_ref;
23461 CHECK((*env)->GetArrayLength(env, a) == 32);
23462 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
23463 LDKCVec_C2Tuple_u32TxOutZZ b_constr;
23464 b_constr.datalen = (*env)->GetArrayLength(env, b);
23465 if (b_constr.datalen > 0)
23466 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
23468 b_constr.data = NULL;
23469 int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
23470 for (size_t u = 0; u < b_constr.datalen; u++) {
23471 int64_t b_conv_20 = b_vals[u];
23472 void* b_conv_20_ptr = untag_ptr(b_conv_20);
23473 CHECK_ACCESS(b_conv_20_ptr);
23474 LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(b_conv_20_ptr);
23475 b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)untag_ptr(b_conv_20));
23476 b_constr.data[u] = b_conv_20_conv;
23478 (*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
23479 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
23480 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr);
23481 return tag_ptr(ret_conv, true);
23484 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23485 if (!ptr_is_owned(_res)) return;
23486 void* _res_ptr = untag_ptr(_res);
23487 CHECK_ACCESS(_res_ptr);
23488 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_ptr);
23489 FREE(untag_ptr(_res));
23490 C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res_conv);
23493 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
23494 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res_constr;
23495 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
23496 if (_res_constr.datalen > 0)
23497 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Elements");
23499 _res_constr.data = NULL;
23500 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
23501 for (size_t n = 0; n < _res_constr.datalen; n++) {
23502 int64_t _res_conv_39 = _res_vals[n];
23503 void* _res_conv_39_ptr = untag_ptr(_res_conv_39);
23504 CHECK_ACCESS(_res_conv_39_ptr);
23505 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_conv_39_ptr);
23506 FREE(untag_ptr(_res_conv_39));
23507 _res_constr.data[n] = _res_conv_39_conv;
23509 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
23510 CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr);
23513 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BalanceZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
23514 LDKCVec_BalanceZ _res_constr;
23515 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
23516 if (_res_constr.datalen > 0)
23517 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBalance), "LDKCVec_BalanceZ Elements");
23519 _res_constr.data = NULL;
23520 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
23521 for (size_t j = 0; j < _res_constr.datalen; j++) {
23522 int64_t _res_conv_9 = _res_vals[j];
23523 void* _res_conv_9_ptr = untag_ptr(_res_conv_9);
23524 CHECK_ACCESS(_res_conv_9_ptr);
23525 LDKBalance _res_conv_9_conv = *(LDKBalance*)(_res_conv_9_ptr);
23526 FREE(untag_ptr(_res_conv_9));
23527 _res_constr.data[j] = _res_conv_9_conv;
23529 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
23530 CVec_BalanceZ_free(_res_constr);
23533 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23534 void* o_ptr = untag_ptr(o);
23535 CHECK_ACCESS(o_ptr);
23536 LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_ptr);
23537 o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(o));
23538 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
23539 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv);
23540 return tag_ptr(ret_conv, true);
23543 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23544 void* e_ptr = untag_ptr(e);
23545 CHECK_ACCESS(e_ptr);
23546 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23547 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23548 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
23549 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv);
23550 return tag_ptr(ret_conv, true);
23553 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23554 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(o);
23555 jboolean ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o_conv);
23559 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23560 if (!ptr_is_owned(_res)) return;
23561 void* _res_ptr = untag_ptr(_res);
23562 CHECK_ACCESS(_res_ptr);
23563 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(_res_ptr);
23564 FREE(untag_ptr(_res));
23565 CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv);
23568 static inline uint64_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) {
23569 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
23570 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg);
23571 return tag_ptr(ret_conv, true);
23573 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23574 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(arg);
23575 int64_t ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv);
23579 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23580 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(orig);
23581 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
23582 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig_conv);
23583 return tag_ptr(ret_conv, true);
23586 static inline uint64_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) {
23587 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
23588 *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg);
23589 return tag_ptr(ret_conv, true);
23591 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23592 LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(arg);
23593 int64_t ret_conv = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv);
23597 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23598 LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(orig);
23599 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
23600 *ret_conv = C2Tuple_PublicKeyTypeZ_clone(orig_conv);
23601 return tag_ptr(ret_conv, true);
23604 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
23605 LDKPublicKey a_ref;
23606 CHECK((*env)->GetArrayLength(env, a) == 33);
23607 (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form);
23608 void* b_ptr = untag_ptr(b);
23609 CHECK_ACCESS(b_ptr);
23610 LDKType b_conv = *(LDKType*)(b_ptr);
23611 if (b_conv.free == LDKType_JCalls_free) {
23612 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23613 LDKType_JCalls_cloned(&b_conv);
23615 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
23616 *ret_conv = C2Tuple_PublicKeyTypeZ_new(a_ref, b_conv);
23617 return tag_ptr(ret_conv, true);
23620 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23621 if (!ptr_is_owned(_res)) return;
23622 void* _res_ptr = untag_ptr(_res);
23623 CHECK_ACCESS(_res_ptr);
23624 LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr);
23625 FREE(untag_ptr(_res));
23626 C2Tuple_PublicKeyTypeZ_free(_res_conv);
23629 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyTypeZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
23630 LDKCVec_C2Tuple_PublicKeyTypeZZ _res_constr;
23631 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
23632 if (_res_constr.datalen > 0)
23633 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
23635 _res_constr.data = NULL;
23636 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
23637 for (size_t z = 0; z < _res_constr.datalen; z++) {
23638 int64_t _res_conv_25 = _res_vals[z];
23639 void* _res_conv_25_ptr = untag_ptr(_res_conv_25);
23640 CHECK_ACCESS(_res_conv_25_ptr);
23641 LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr);
23642 FREE(untag_ptr(_res_conv_25));
23643 _res_constr.data[z] = _res_conv_25_conv;
23645 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
23646 CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr);
23649 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1some(JNIEnv *env, jclass clz, int64_t o) {
23650 void* o_ptr = untag_ptr(o);
23651 CHECK_ACCESS(o_ptr);
23652 LDKCustomOnionMessageContents o_conv = *(LDKCustomOnionMessageContents*)(o_ptr);
23653 if (o_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
23654 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23655 LDKCustomOnionMessageContents_JCalls_cloned(&o_conv);
23657 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
23658 *ret_copy = COption_CustomOnionMessageContentsZ_some(o_conv);
23659 int64_t ret_ref = tag_ptr(ret_copy, true);
23663 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1none(JNIEnv *env, jclass clz) {
23664 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
23665 *ret_copy = COption_CustomOnionMessageContentsZ_none();
23666 int64_t ret_ref = tag_ptr(ret_copy, true);
23670 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23671 if (!ptr_is_owned(_res)) return;
23672 void* _res_ptr = untag_ptr(_res);
23673 CHECK_ACCESS(_res_ptr);
23674 LDKCOption_CustomOnionMessageContentsZ _res_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(_res_ptr);
23675 FREE(untag_ptr(_res));
23676 COption_CustomOnionMessageContentsZ_free(_res_conv);
23679 static inline uint64_t COption_CustomOnionMessageContentsZ_clone_ptr(LDKCOption_CustomOnionMessageContentsZ *NONNULL_PTR arg) {
23680 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
23681 *ret_copy = COption_CustomOnionMessageContentsZ_clone(arg);
23682 int64_t ret_ref = tag_ptr(ret_copy, true);
23685 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23686 LDKCOption_CustomOnionMessageContentsZ* arg_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(arg);
23687 int64_t ret_conv = COption_CustomOnionMessageContentsZ_clone_ptr(arg_conv);
23691 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23692 LDKCOption_CustomOnionMessageContentsZ* orig_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(orig);
23693 LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
23694 *ret_copy = COption_CustomOnionMessageContentsZ_clone(orig_conv);
23695 int64_t ret_ref = tag_ptr(ret_copy, true);
23699 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
23700 void* o_ptr = untag_ptr(o);
23701 CHECK_ACCESS(o_ptr);
23702 LDKCOption_CustomOnionMessageContentsZ o_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(o_ptr);
23703 o_conv = COption_CustomOnionMessageContentsZ_clone((LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(o));
23704 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
23705 *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(o_conv);
23706 return tag_ptr(ret_conv, true);
23709 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23710 void* e_ptr = untag_ptr(e);
23711 CHECK_ACCESS(e_ptr);
23712 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
23713 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
23714 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
23715 *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(e_conv);
23716 return tag_ptr(ret_conv, true);
23719 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23720 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* o_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(o);
23721 jboolean ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(o_conv);
23725 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23726 if (!ptr_is_owned(_res)) return;
23727 void* _res_ptr = untag_ptr(_res);
23728 CHECK_ACCESS(_res_ptr);
23729 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(_res_ptr);
23730 FREE(untag_ptr(_res));
23731 CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(_res_conv);
23734 static inline uint64_t CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR arg) {
23735 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
23736 *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(arg);
23737 return tag_ptr(ret_conv, true);
23739 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23740 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* arg_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(arg);
23741 int64_t ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(arg_conv);
23745 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23746 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* orig_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(orig);
23747 LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
23748 *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(orig_conv);
23749 return tag_ptr(ret_conv, true);
23752 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1some(JNIEnv *env, jclass clz, int64_t o) {
23753 void* o_ptr = untag_ptr(o);
23754 CHECK_ACCESS(o_ptr);
23755 LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
23756 o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
23757 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
23758 *ret_copy = COption_NetAddressZ_some(o_conv);
23759 int64_t ret_ref = tag_ptr(ret_copy, true);
23763 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1none(JNIEnv *env, jclass clz) {
23764 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
23765 *ret_copy = COption_NetAddressZ_none();
23766 int64_t ret_ref = tag_ptr(ret_copy, true);
23770 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23771 if (!ptr_is_owned(_res)) return;
23772 void* _res_ptr = untag_ptr(_res);
23773 CHECK_ACCESS(_res_ptr);
23774 LDKCOption_NetAddressZ _res_conv = *(LDKCOption_NetAddressZ*)(_res_ptr);
23775 FREE(untag_ptr(_res));
23776 COption_NetAddressZ_free(_res_conv);
23779 static inline uint64_t COption_NetAddressZ_clone_ptr(LDKCOption_NetAddressZ *NONNULL_PTR arg) {
23780 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
23781 *ret_copy = COption_NetAddressZ_clone(arg);
23782 int64_t ret_ref = tag_ptr(ret_copy, true);
23785 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23786 LDKCOption_NetAddressZ* arg_conv = (LDKCOption_NetAddressZ*)untag_ptr(arg);
23787 int64_t ret_conv = COption_NetAddressZ_clone_ptr(arg_conv);
23791 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23792 LDKCOption_NetAddressZ* orig_conv = (LDKCOption_NetAddressZ*)untag_ptr(orig);
23793 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
23794 *ret_copy = COption_NetAddressZ_clone(orig_conv);
23795 int64_t ret_ref = tag_ptr(ret_copy, true);
23799 static inline uint64_t C2Tuple_PublicKeyCOption_NetAddressZZ_clone_ptr(LDKC2Tuple_PublicKeyCOption_NetAddressZZ *NONNULL_PTR arg) {
23800 LDKC2Tuple_PublicKeyCOption_NetAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_NetAddressZZ), "LDKC2Tuple_PublicKeyCOption_NetAddressZZ");
23801 *ret_conv = C2Tuple_PublicKeyCOption_NetAddressZZ_clone(arg);
23802 return tag_ptr(ret_conv, true);
23804 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCOption_1NetAddressZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23805 LDKC2Tuple_PublicKeyCOption_NetAddressZZ* arg_conv = (LDKC2Tuple_PublicKeyCOption_NetAddressZZ*)untag_ptr(arg);
23806 int64_t ret_conv = C2Tuple_PublicKeyCOption_NetAddressZZ_clone_ptr(arg_conv);
23810 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCOption_1NetAddressZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23811 LDKC2Tuple_PublicKeyCOption_NetAddressZZ* orig_conv = (LDKC2Tuple_PublicKeyCOption_NetAddressZZ*)untag_ptr(orig);
23812 LDKC2Tuple_PublicKeyCOption_NetAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_NetAddressZZ), "LDKC2Tuple_PublicKeyCOption_NetAddressZZ");
23813 *ret_conv = C2Tuple_PublicKeyCOption_NetAddressZZ_clone(orig_conv);
23814 return tag_ptr(ret_conv, true);
23817 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCOption_1NetAddressZZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) {
23818 LDKPublicKey a_ref;
23819 CHECK((*env)->GetArrayLength(env, a) == 33);
23820 (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form);
23821 void* b_ptr = untag_ptr(b);
23822 CHECK_ACCESS(b_ptr);
23823 LDKCOption_NetAddressZ b_conv = *(LDKCOption_NetAddressZ*)(b_ptr);
23824 b_conv = COption_NetAddressZ_clone((LDKCOption_NetAddressZ*)untag_ptr(b));
23825 LDKC2Tuple_PublicKeyCOption_NetAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_NetAddressZZ), "LDKC2Tuple_PublicKeyCOption_NetAddressZZ");
23826 *ret_conv = C2Tuple_PublicKeyCOption_NetAddressZZ_new(a_ref, b_conv);
23827 return tag_ptr(ret_conv, true);
23830 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyCOption_1NetAddressZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23831 if (!ptr_is_owned(_res)) return;
23832 void* _res_ptr = untag_ptr(_res);
23833 CHECK_ACCESS(_res_ptr);
23834 LDKC2Tuple_PublicKeyCOption_NetAddressZZ _res_conv = *(LDKC2Tuple_PublicKeyCOption_NetAddressZZ*)(_res_ptr);
23835 FREE(untag_ptr(_res));
23836 C2Tuple_PublicKeyCOption_NetAddressZZ_free(_res_conv);
23839 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyCOption_1NetAddressZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
23840 LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ _res_constr;
23841 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
23842 if (_res_constr.datalen > 0)
23843 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyCOption_NetAddressZZ), "LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ Elements");
23845 _res_constr.data = NULL;
23846 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
23847 for (size_t o = 0; o < _res_constr.datalen; o++) {
23848 int64_t _res_conv_40 = _res_vals[o];
23849 void* _res_conv_40_ptr = untag_ptr(_res_conv_40);
23850 CHECK_ACCESS(_res_conv_40_ptr);
23851 LDKC2Tuple_PublicKeyCOption_NetAddressZZ _res_conv_40_conv = *(LDKC2Tuple_PublicKeyCOption_NetAddressZZ*)(_res_conv_40_ptr);
23852 FREE(untag_ptr(_res_conv_40));
23853 _res_constr.data[o] = _res_conv_40_conv;
23855 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
23856 CVec_C2Tuple_PublicKeyCOption_NetAddressZZZ_free(_res_constr);
23859 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
23861 o_ref.datalen = (*env)->GetArrayLength(env, o);
23862 o_ref.data = MALLOC(o_ref.datalen, "LDKCVec_u8Z Bytes");
23863 (*env)->GetByteArrayRegion(env, o, 0, o_ref.datalen, o_ref.data);
23864 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
23865 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(o_ref);
23866 return tag_ptr(ret_conv, true);
23869 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23870 LDKPeerHandleError e_conv;
23871 e_conv.inner = untag_ptr(e);
23872 e_conv.is_owned = ptr_is_owned(e);
23873 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
23874 e_conv = PeerHandleError_clone(&e_conv);
23875 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
23876 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv);
23877 return tag_ptr(ret_conv, true);
23880 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23881 LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(o);
23882 jboolean ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv);
23886 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23887 if (!ptr_is_owned(_res)) return;
23888 void* _res_ptr = untag_ptr(_res);
23889 CHECK_ACCESS(_res_ptr);
23890 LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr);
23891 FREE(untag_ptr(_res));
23892 CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv);
23895 static inline uint64_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) {
23896 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
23897 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg);
23898 return tag_ptr(ret_conv, true);
23900 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23901 LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(arg);
23902 int64_t ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv);
23906 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23907 LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(orig);
23908 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
23909 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(orig_conv);
23910 return tag_ptr(ret_conv, true);
23913 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv *env, jclass clz) {
23914 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
23915 *ret_conv = CResult_NonePeerHandleErrorZ_ok();
23916 return tag_ptr(ret_conv, true);
23919 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23920 LDKPeerHandleError e_conv;
23921 e_conv.inner = untag_ptr(e);
23922 e_conv.is_owned = ptr_is_owned(e);
23923 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
23924 e_conv = PeerHandleError_clone(&e_conv);
23925 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
23926 *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv);
23927 return tag_ptr(ret_conv, true);
23930 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23931 LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(o);
23932 jboolean ret_conv = CResult_NonePeerHandleErrorZ_is_ok(o_conv);
23936 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23937 if (!ptr_is_owned(_res)) return;
23938 void* _res_ptr = untag_ptr(_res);
23939 CHECK_ACCESS(_res_ptr);
23940 LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr);
23941 FREE(untag_ptr(_res));
23942 CResult_NonePeerHandleErrorZ_free(_res_conv);
23945 static inline uint64_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) {
23946 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
23947 *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg);
23948 return tag_ptr(ret_conv, true);
23950 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
23951 LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(arg);
23952 int64_t ret_conv = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv);
23956 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
23957 LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(orig);
23958 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
23959 *ret_conv = CResult_NonePeerHandleErrorZ_clone(orig_conv);
23960 return tag_ptr(ret_conv, true);
23963 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv *env, jclass clz, jboolean o) {
23964 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
23965 *ret_conv = CResult_boolPeerHandleErrorZ_ok(o);
23966 return tag_ptr(ret_conv, true);
23969 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
23970 LDKPeerHandleError e_conv;
23971 e_conv.inner = untag_ptr(e);
23972 e_conv.is_owned = ptr_is_owned(e);
23973 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
23974 e_conv = PeerHandleError_clone(&e_conv);
23975 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
23976 *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv);
23977 return tag_ptr(ret_conv, true);
23980 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
23981 LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(o);
23982 jboolean ret_conv = CResult_boolPeerHandleErrorZ_is_ok(o_conv);
23986 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
23987 if (!ptr_is_owned(_res)) return;
23988 void* _res_ptr = untag_ptr(_res);
23989 CHECK_ACCESS(_res_ptr);
23990 LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr);
23991 FREE(untag_ptr(_res));
23992 CResult_boolPeerHandleErrorZ_free(_res_conv);
23995 static inline uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) {
23996 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
23997 *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg);
23998 return tag_ptr(ret_conv, true);
24000 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24001 LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(arg);
24002 int64_t ret_conv = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv);
24006 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24007 LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(orig);
24008 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
24009 *ret_conv = CResult_boolPeerHandleErrorZ_clone(orig_conv);
24010 return tag_ptr(ret_conv, true);
24013 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24014 void* o_ptr = untag_ptr(o);
24015 CHECK_ACCESS(o_ptr);
24016 LDKTxOut o_conv = *(LDKTxOut*)(o_ptr);
24017 o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o));
24018 LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ");
24019 *ret_conv = CResult_TxOutUtxoLookupErrorZ_ok(o_conv);
24020 return tag_ptr(ret_conv, true);
24023 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
24024 LDKUtxoLookupError e_conv = LDKUtxoLookupError_from_java(env, e);
24025 LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ");
24026 *ret_conv = CResult_TxOutUtxoLookupErrorZ_err(e_conv);
24027 return tag_ptr(ret_conv, true);
24030 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24031 LDKCResult_TxOutUtxoLookupErrorZ* o_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(o);
24032 jboolean ret_conv = CResult_TxOutUtxoLookupErrorZ_is_ok(o_conv);
24036 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24037 if (!ptr_is_owned(_res)) return;
24038 void* _res_ptr = untag_ptr(_res);
24039 CHECK_ACCESS(_res_ptr);
24040 LDKCResult_TxOutUtxoLookupErrorZ _res_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(_res_ptr);
24041 FREE(untag_ptr(_res));
24042 CResult_TxOutUtxoLookupErrorZ_free(_res_conv);
24045 static inline uint64_t CResult_TxOutUtxoLookupErrorZ_clone_ptr(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR arg) {
24046 LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ");
24047 *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(arg);
24048 return tag_ptr(ret_conv, true);
24050 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24051 LDKCResult_TxOutUtxoLookupErrorZ* arg_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(arg);
24052 int64_t ret_conv = CResult_TxOutUtxoLookupErrorZ_clone_ptr(arg_conv);
24056 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutUtxoLookupErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24057 LDKCResult_TxOutUtxoLookupErrorZ* orig_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(orig);
24058 LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ");
24059 *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(orig_conv);
24060 return tag_ptr(ret_conv, true);
24063 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1ok(JNIEnv *env, jclass clz) {
24064 LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
24065 *ret_conv = CResult_NoneSendErrorZ_ok();
24066 return tag_ptr(ret_conv, true);
24069 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24070 void* e_ptr = untag_ptr(e);
24071 CHECK_ACCESS(e_ptr);
24072 LDKSendError e_conv = *(LDKSendError*)(e_ptr);
24073 e_conv = SendError_clone((LDKSendError*)untag_ptr(e));
24074 LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
24075 *ret_conv = CResult_NoneSendErrorZ_err(e_conv);
24076 return tag_ptr(ret_conv, true);
24079 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24080 LDKCResult_NoneSendErrorZ* o_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(o);
24081 jboolean ret_conv = CResult_NoneSendErrorZ_is_ok(o_conv);
24085 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24086 if (!ptr_is_owned(_res)) return;
24087 void* _res_ptr = untag_ptr(_res);
24088 CHECK_ACCESS(_res_ptr);
24089 LDKCResult_NoneSendErrorZ _res_conv = *(LDKCResult_NoneSendErrorZ*)(_res_ptr);
24090 FREE(untag_ptr(_res));
24091 CResult_NoneSendErrorZ_free(_res_conv);
24094 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24095 LDKBlindedPath o_conv;
24096 o_conv.inner = untag_ptr(o);
24097 o_conv.is_owned = ptr_is_owned(o);
24098 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24099 o_conv = BlindedPath_clone(&o_conv);
24100 LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ");
24101 *ret_conv = CResult_BlindedPathNoneZ_ok(o_conv);
24102 return tag_ptr(ret_conv, true);
24105 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1err(JNIEnv *env, jclass clz) {
24106 LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ");
24107 *ret_conv = CResult_BlindedPathNoneZ_err();
24108 return tag_ptr(ret_conv, true);
24111 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24112 LDKCResult_BlindedPathNoneZ* o_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(o);
24113 jboolean ret_conv = CResult_BlindedPathNoneZ_is_ok(o_conv);
24117 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24118 if (!ptr_is_owned(_res)) return;
24119 void* _res_ptr = untag_ptr(_res);
24120 CHECK_ACCESS(_res_ptr);
24121 LDKCResult_BlindedPathNoneZ _res_conv = *(LDKCResult_BlindedPathNoneZ*)(_res_ptr);
24122 FREE(untag_ptr(_res));
24123 CResult_BlindedPathNoneZ_free(_res_conv);
24126 static inline uint64_t CResult_BlindedPathNoneZ_clone_ptr(LDKCResult_BlindedPathNoneZ *NONNULL_PTR arg) {
24127 LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ");
24128 *ret_conv = CResult_BlindedPathNoneZ_clone(arg);
24129 return tag_ptr(ret_conv, true);
24131 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24132 LDKCResult_BlindedPathNoneZ* arg_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(arg);
24133 int64_t ret_conv = CResult_BlindedPathNoneZ_clone_ptr(arg_conv);
24137 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24138 LDKCResult_BlindedPathNoneZ* orig_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(orig);
24139 LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ");
24140 *ret_conv = CResult_BlindedPathNoneZ_clone(orig_conv);
24141 return tag_ptr(ret_conv, true);
24144 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24145 LDKBlindedPath o_conv;
24146 o_conv.inner = untag_ptr(o);
24147 o_conv.is_owned = ptr_is_owned(o);
24148 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24149 o_conv = BlindedPath_clone(&o_conv);
24150 LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ");
24151 *ret_conv = CResult_BlindedPathDecodeErrorZ_ok(o_conv);
24152 return tag_ptr(ret_conv, true);
24155 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24156 void* e_ptr = untag_ptr(e);
24157 CHECK_ACCESS(e_ptr);
24158 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24159 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24160 LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ");
24161 *ret_conv = CResult_BlindedPathDecodeErrorZ_err(e_conv);
24162 return tag_ptr(ret_conv, true);
24165 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24166 LDKCResult_BlindedPathDecodeErrorZ* o_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(o);
24167 jboolean ret_conv = CResult_BlindedPathDecodeErrorZ_is_ok(o_conv);
24171 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24172 if (!ptr_is_owned(_res)) return;
24173 void* _res_ptr = untag_ptr(_res);
24174 CHECK_ACCESS(_res_ptr);
24175 LDKCResult_BlindedPathDecodeErrorZ _res_conv = *(LDKCResult_BlindedPathDecodeErrorZ*)(_res_ptr);
24176 FREE(untag_ptr(_res));
24177 CResult_BlindedPathDecodeErrorZ_free(_res_conv);
24180 static inline uint64_t CResult_BlindedPathDecodeErrorZ_clone_ptr(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR arg) {
24181 LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ");
24182 *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(arg);
24183 return tag_ptr(ret_conv, true);
24185 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24186 LDKCResult_BlindedPathDecodeErrorZ* arg_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(arg);
24187 int64_t ret_conv = CResult_BlindedPathDecodeErrorZ_clone_ptr(arg_conv);
24191 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24192 LDKCResult_BlindedPathDecodeErrorZ* orig_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(orig);
24193 LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ");
24194 *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(orig_conv);
24195 return tag_ptr(ret_conv, true);
24198 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24199 LDKBlindedHop o_conv;
24200 o_conv.inner = untag_ptr(o);
24201 o_conv.is_owned = ptr_is_owned(o);
24202 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24203 o_conv = BlindedHop_clone(&o_conv);
24204 LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
24205 *ret_conv = CResult_BlindedHopDecodeErrorZ_ok(o_conv);
24206 return tag_ptr(ret_conv, true);
24209 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24210 void* e_ptr = untag_ptr(e);
24211 CHECK_ACCESS(e_ptr);
24212 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24213 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24214 LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
24215 *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv);
24216 return tag_ptr(ret_conv, true);
24219 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24220 LDKCResult_BlindedHopDecodeErrorZ* o_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(o);
24221 jboolean ret_conv = CResult_BlindedHopDecodeErrorZ_is_ok(o_conv);
24225 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24226 if (!ptr_is_owned(_res)) return;
24227 void* _res_ptr = untag_ptr(_res);
24228 CHECK_ACCESS(_res_ptr);
24229 LDKCResult_BlindedHopDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopDecodeErrorZ*)(_res_ptr);
24230 FREE(untag_ptr(_res));
24231 CResult_BlindedHopDecodeErrorZ_free(_res_conv);
24234 static inline uint64_t CResult_BlindedHopDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR arg) {
24235 LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
24236 *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(arg);
24237 return tag_ptr(ret_conv, true);
24239 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24240 LDKCResult_BlindedHopDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(arg);
24241 int64_t ret_conv = CResult_BlindedHopDecodeErrorZ_clone_ptr(arg_conv);
24245 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24246 LDKCResult_BlindedHopDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(orig);
24247 LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
24248 *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(orig_conv);
24249 return tag_ptr(ret_conv, true);
24252 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1ok(JNIEnv *env, jclass clz, jclass o) {
24253 LDKSiPrefix o_conv = LDKSiPrefix_from_java(env, o);
24254 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
24255 *ret_conv = CResult_SiPrefixParseErrorZ_ok(o_conv);
24256 return tag_ptr(ret_conv, true);
24259 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24260 void* e_ptr = untag_ptr(e);
24261 CHECK_ACCESS(e_ptr);
24262 LDKParseError e_conv = *(LDKParseError*)(e_ptr);
24263 e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
24264 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
24265 *ret_conv = CResult_SiPrefixParseErrorZ_err(e_conv);
24266 return tag_ptr(ret_conv, true);
24269 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24270 LDKCResult_SiPrefixParseErrorZ* o_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(o);
24271 jboolean ret_conv = CResult_SiPrefixParseErrorZ_is_ok(o_conv);
24275 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24276 if (!ptr_is_owned(_res)) return;
24277 void* _res_ptr = untag_ptr(_res);
24278 CHECK_ACCESS(_res_ptr);
24279 LDKCResult_SiPrefixParseErrorZ _res_conv = *(LDKCResult_SiPrefixParseErrorZ*)(_res_ptr);
24280 FREE(untag_ptr(_res));
24281 CResult_SiPrefixParseErrorZ_free(_res_conv);
24284 static inline uint64_t CResult_SiPrefixParseErrorZ_clone_ptr(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR arg) {
24285 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
24286 *ret_conv = CResult_SiPrefixParseErrorZ_clone(arg);
24287 return tag_ptr(ret_conv, true);
24289 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24290 LDKCResult_SiPrefixParseErrorZ* arg_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(arg);
24291 int64_t ret_conv = CResult_SiPrefixParseErrorZ_clone_ptr(arg_conv);
24295 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24296 LDKCResult_SiPrefixParseErrorZ* orig_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(orig);
24297 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
24298 *ret_conv = CResult_SiPrefixParseErrorZ_clone(orig_conv);
24299 return tag_ptr(ret_conv, true);
24302 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24304 o_conv.inner = untag_ptr(o);
24305 o_conv.is_owned = ptr_is_owned(o);
24306 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24307 o_conv = Invoice_clone(&o_conv);
24308 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
24309 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_ok(o_conv);
24310 return tag_ptr(ret_conv, true);
24313 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24314 void* e_ptr = untag_ptr(e);
24315 CHECK_ACCESS(e_ptr);
24316 LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr);
24317 e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e));
24318 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
24319 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_err(e_conv);
24320 return tag_ptr(ret_conv, true);
24323 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24324 LDKCResult_InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(o);
24325 jboolean ret_conv = CResult_InvoiceParseOrSemanticErrorZ_is_ok(o_conv);
24329 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24330 if (!ptr_is_owned(_res)) return;
24331 void* _res_ptr = untag_ptr(_res);
24332 CHECK_ACCESS(_res_ptr);
24333 LDKCResult_InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_InvoiceParseOrSemanticErrorZ*)(_res_ptr);
24334 FREE(untag_ptr(_res));
24335 CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv);
24338 static inline uint64_t CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) {
24339 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
24340 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(arg);
24341 return tag_ptr(ret_conv, true);
24343 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24344 LDKCResult_InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(arg);
24345 int64_t ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(arg_conv);
24349 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24350 LDKCResult_InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(orig);
24351 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
24352 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(orig_conv);
24353 return tag_ptr(ret_conv, true);
24356 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24357 LDKSignedRawInvoice o_conv;
24358 o_conv.inner = untag_ptr(o);
24359 o_conv.is_owned = ptr_is_owned(o);
24360 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24361 o_conv = SignedRawInvoice_clone(&o_conv);
24362 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
24363 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_ok(o_conv);
24364 return tag_ptr(ret_conv, true);
24367 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24368 void* e_ptr = untag_ptr(e);
24369 CHECK_ACCESS(e_ptr);
24370 LDKParseError e_conv = *(LDKParseError*)(e_ptr);
24371 e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
24372 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
24373 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_err(e_conv);
24374 return tag_ptr(ret_conv, true);
24377 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24378 LDKCResult_SignedRawInvoiceParseErrorZ* o_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(o);
24379 jboolean ret_conv = CResult_SignedRawInvoiceParseErrorZ_is_ok(o_conv);
24383 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24384 if (!ptr_is_owned(_res)) return;
24385 void* _res_ptr = untag_ptr(_res);
24386 CHECK_ACCESS(_res_ptr);
24387 LDKCResult_SignedRawInvoiceParseErrorZ _res_conv = *(LDKCResult_SignedRawInvoiceParseErrorZ*)(_res_ptr);
24388 FREE(untag_ptr(_res));
24389 CResult_SignedRawInvoiceParseErrorZ_free(_res_conv);
24392 static inline uint64_t CResult_SignedRawInvoiceParseErrorZ_clone_ptr(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR arg) {
24393 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
24394 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(arg);
24395 return tag_ptr(ret_conv, true);
24397 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24398 LDKCResult_SignedRawInvoiceParseErrorZ* arg_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(arg);
24399 int64_t ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone_ptr(arg_conv);
24403 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24404 LDKCResult_SignedRawInvoiceParseErrorZ* orig_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(orig);
24405 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
24406 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(orig_conv);
24407 return tag_ptr(ret_conv, true);
24410 static inline uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) {
24411 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
24412 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg);
24413 return tag_ptr(ret_conv, true);
24415 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24416 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(arg);
24417 int64_t ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv);
24421 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24422 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(orig);
24423 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
24424 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig_conv);
24425 return tag_ptr(ret_conv, true);
24428 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) {
24429 LDKRawInvoice a_conv;
24430 a_conv.inner = untag_ptr(a);
24431 a_conv.is_owned = ptr_is_owned(a);
24432 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
24433 a_conv = RawInvoice_clone(&a_conv);
24434 LDKThirtyTwoBytes b_ref;
24435 CHECK((*env)->GetArrayLength(env, b) == 32);
24436 (*env)->GetByteArrayRegion(env, b, 0, 32, b_ref.data);
24437 LDKInvoiceSignature c_conv;
24438 c_conv.inner = untag_ptr(c);
24439 c_conv.is_owned = ptr_is_owned(c);
24440 CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
24441 c_conv = InvoiceSignature_clone(&c_conv);
24442 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
24443 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv);
24444 return tag_ptr(ret_conv, true);
24447 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24448 if (!ptr_is_owned(_res)) return;
24449 void* _res_ptr = untag_ptr(_res);
24450 CHECK_ACCESS(_res_ptr);
24451 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr);
24452 FREE(untag_ptr(_res));
24453 C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv);
24456 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24457 LDKPayeePubKey o_conv;
24458 o_conv.inner = untag_ptr(o);
24459 o_conv.is_owned = ptr_is_owned(o);
24460 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24461 o_conv = PayeePubKey_clone(&o_conv);
24462 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
24463 *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv);
24464 return tag_ptr(ret_conv, true);
24467 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
24468 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e);
24469 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
24470 *ret_conv = CResult_PayeePubKeyErrorZ_err(e_conv);
24471 return tag_ptr(ret_conv, true);
24474 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24475 LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(o);
24476 jboolean ret_conv = CResult_PayeePubKeyErrorZ_is_ok(o_conv);
24480 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24481 if (!ptr_is_owned(_res)) return;
24482 void* _res_ptr = untag_ptr(_res);
24483 CHECK_ACCESS(_res_ptr);
24484 LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr);
24485 FREE(untag_ptr(_res));
24486 CResult_PayeePubKeyErrorZ_free(_res_conv);
24489 static inline uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) {
24490 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
24491 *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg);
24492 return tag_ptr(ret_conv, true);
24494 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24495 LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(arg);
24496 int64_t ret_conv = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv);
24500 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24501 LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(orig);
24502 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
24503 *ret_conv = CResult_PayeePubKeyErrorZ_clone(orig_conv);
24504 return tag_ptr(ret_conv, true);
24507 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PrivateRouteZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
24508 LDKCVec_PrivateRouteZ _res_constr;
24509 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
24510 if (_res_constr.datalen > 0)
24511 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements");
24513 _res_constr.data = NULL;
24514 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
24515 for (size_t o = 0; o < _res_constr.datalen; o++) {
24516 int64_t _res_conv_14 = _res_vals[o];
24517 LDKPrivateRoute _res_conv_14_conv;
24518 _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
24519 _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
24520 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
24521 _res_constr.data[o] = _res_conv_14_conv;
24523 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
24524 CVec_PrivateRouteZ_free(_res_constr);
24527 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24528 LDKPositiveTimestamp o_conv;
24529 o_conv.inner = untag_ptr(o);
24530 o_conv.is_owned = ptr_is_owned(o);
24531 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24532 o_conv = PositiveTimestamp_clone(&o_conv);
24533 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
24534 *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv);
24535 return tag_ptr(ret_conv, true);
24538 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
24539 LDKCreationError e_conv = LDKCreationError_from_java(env, e);
24540 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
24541 *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv);
24542 return tag_ptr(ret_conv, true);
24545 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24546 LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(o);
24547 jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv);
24551 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24552 if (!ptr_is_owned(_res)) return;
24553 void* _res_ptr = untag_ptr(_res);
24554 CHECK_ACCESS(_res_ptr);
24555 LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr);
24556 FREE(untag_ptr(_res));
24557 CResult_PositiveTimestampCreationErrorZ_free(_res_conv);
24560 static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) {
24561 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
24562 *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg);
24563 return tag_ptr(ret_conv, true);
24565 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24566 LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(arg);
24567 int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv);
24571 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24572 LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(orig);
24573 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
24574 *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv);
24575 return tag_ptr(ret_conv, true);
24578 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1ok(JNIEnv *env, jclass clz) {
24579 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
24580 *ret_conv = CResult_NoneSemanticErrorZ_ok();
24581 return tag_ptr(ret_conv, true);
24584 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
24585 LDKSemanticError e_conv = LDKSemanticError_from_java(env, e);
24586 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
24587 *ret_conv = CResult_NoneSemanticErrorZ_err(e_conv);
24588 return tag_ptr(ret_conv, true);
24591 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24592 LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(o);
24593 jboolean ret_conv = CResult_NoneSemanticErrorZ_is_ok(o_conv);
24597 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24598 if (!ptr_is_owned(_res)) return;
24599 void* _res_ptr = untag_ptr(_res);
24600 CHECK_ACCESS(_res_ptr);
24601 LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr);
24602 FREE(untag_ptr(_res));
24603 CResult_NoneSemanticErrorZ_free(_res_conv);
24606 static inline uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) {
24607 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
24608 *ret_conv = CResult_NoneSemanticErrorZ_clone(arg);
24609 return tag_ptr(ret_conv, true);
24611 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24612 LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(arg);
24613 int64_t ret_conv = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv);
24617 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24618 LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(orig);
24619 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
24620 *ret_conv = CResult_NoneSemanticErrorZ_clone(orig_conv);
24621 return tag_ptr(ret_conv, true);
24624 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24626 o_conv.inner = untag_ptr(o);
24627 o_conv.is_owned = ptr_is_owned(o);
24628 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24629 o_conv = Invoice_clone(&o_conv);
24630 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
24631 *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv);
24632 return tag_ptr(ret_conv, true);
24635 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
24636 LDKSemanticError e_conv = LDKSemanticError_from_java(env, e);
24637 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
24638 *ret_conv = CResult_InvoiceSemanticErrorZ_err(e_conv);
24639 return tag_ptr(ret_conv, true);
24642 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24643 LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(o);
24644 jboolean ret_conv = CResult_InvoiceSemanticErrorZ_is_ok(o_conv);
24648 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24649 if (!ptr_is_owned(_res)) return;
24650 void* _res_ptr = untag_ptr(_res);
24651 CHECK_ACCESS(_res_ptr);
24652 LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr);
24653 FREE(untag_ptr(_res));
24654 CResult_InvoiceSemanticErrorZ_free(_res_conv);
24657 static inline uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) {
24658 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
24659 *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg);
24660 return tag_ptr(ret_conv, true);
24662 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24663 LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(arg);
24664 int64_t ret_conv = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv);
24668 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24669 LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(orig);
24670 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
24671 *ret_conv = CResult_InvoiceSemanticErrorZ_clone(orig_conv);
24672 return tag_ptr(ret_conv, true);
24675 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1AddressZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) {
24676 LDKCVec_AddressZ _res_constr;
24677 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
24678 if (_res_constr.datalen > 0)
24679 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKStr), "LDKCVec_AddressZ Elements");
24681 _res_constr.data = NULL;
24682 for (size_t i = 0; i < _res_constr.datalen; i++) {
24683 jstring _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i);
24684 LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false };
24685 _res_constr.data[i] = dummy;
24687 CVec_AddressZ_free(_res_constr);
24690 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24691 LDKDescription o_conv;
24692 o_conv.inner = untag_ptr(o);
24693 o_conv.is_owned = ptr_is_owned(o);
24694 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24695 o_conv = Description_clone(&o_conv);
24696 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
24697 *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv);
24698 return tag_ptr(ret_conv, true);
24701 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
24702 LDKCreationError e_conv = LDKCreationError_from_java(env, e);
24703 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
24704 *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv);
24705 return tag_ptr(ret_conv, true);
24708 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24709 LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(o);
24710 jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv);
24714 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24715 if (!ptr_is_owned(_res)) return;
24716 void* _res_ptr = untag_ptr(_res);
24717 CHECK_ACCESS(_res_ptr);
24718 LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr);
24719 FREE(untag_ptr(_res));
24720 CResult_DescriptionCreationErrorZ_free(_res_conv);
24723 static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) {
24724 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
24725 *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg);
24726 return tag_ptr(ret_conv, true);
24728 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24729 LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(arg);
24730 int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv);
24734 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24735 LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(orig);
24736 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
24737 *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv);
24738 return tag_ptr(ret_conv, true);
24741 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24742 LDKPrivateRoute o_conv;
24743 o_conv.inner = untag_ptr(o);
24744 o_conv.is_owned = ptr_is_owned(o);
24745 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24746 o_conv = PrivateRoute_clone(&o_conv);
24747 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
24748 *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv);
24749 return tag_ptr(ret_conv, true);
24752 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1err(JNIEnv *env, jclass clz, jclass e) {
24753 LDKCreationError e_conv = LDKCreationError_from_java(env, e);
24754 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
24755 *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv);
24756 return tag_ptr(ret_conv, true);
24759 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24760 LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(o);
24761 jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv);
24765 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24766 if (!ptr_is_owned(_res)) return;
24767 void* _res_ptr = untag_ptr(_res);
24768 CHECK_ACCESS(_res_ptr);
24769 LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr);
24770 FREE(untag_ptr(_res));
24771 CResult_PrivateRouteCreationErrorZ_free(_res_conv);
24774 static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) {
24775 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
24776 *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg);
24777 return tag_ptr(ret_conv, true);
24779 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24780 LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(arg);
24781 int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv);
24785 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24786 LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(orig);
24787 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
24788 *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv);
24789 return tag_ptr(ret_conv, true);
24792 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24793 void* o_ptr = untag_ptr(o);
24794 CHECK_ACCESS(o_ptr);
24795 LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
24796 o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
24797 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
24798 *ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv);
24799 return tag_ptr(ret_conv, true);
24802 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24803 void* e_ptr = untag_ptr(e);
24804 CHECK_ACCESS(e_ptr);
24805 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24806 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24807 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
24808 *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv);
24809 return tag_ptr(ret_conv, true);
24812 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24813 LDKCResult_NetAddressDecodeErrorZ* o_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(o);
24814 jboolean ret_conv = CResult_NetAddressDecodeErrorZ_is_ok(o_conv);
24818 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24819 if (!ptr_is_owned(_res)) return;
24820 void* _res_ptr = untag_ptr(_res);
24821 CHECK_ACCESS(_res_ptr);
24822 LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr);
24823 FREE(untag_ptr(_res));
24824 CResult_NetAddressDecodeErrorZ_free(_res_conv);
24827 static inline uint64_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg) {
24828 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
24829 *ret_conv = CResult_NetAddressDecodeErrorZ_clone(arg);
24830 return tag_ptr(ret_conv, true);
24832 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24833 LDKCResult_NetAddressDecodeErrorZ* arg_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(arg);
24834 int64_t ret_conv = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv);
24838 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24839 LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(orig);
24840 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
24841 *ret_conv = CResult_NetAddressDecodeErrorZ_clone(orig_conv);
24842 return tag_ptr(ret_conv, true);
24845 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
24846 LDKCVec_UpdateAddHTLCZ _res_constr;
24847 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
24848 if (_res_constr.datalen > 0)
24849 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
24851 _res_constr.data = NULL;
24852 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
24853 for (size_t p = 0; p < _res_constr.datalen; p++) {
24854 int64_t _res_conv_15 = _res_vals[p];
24855 LDKUpdateAddHTLC _res_conv_15_conv;
24856 _res_conv_15_conv.inner = untag_ptr(_res_conv_15);
24857 _res_conv_15_conv.is_owned = ptr_is_owned(_res_conv_15);
24858 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_15_conv);
24859 _res_constr.data[p] = _res_conv_15_conv;
24861 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
24862 CVec_UpdateAddHTLCZ_free(_res_constr);
24865 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
24866 LDKCVec_UpdateFulfillHTLCZ _res_constr;
24867 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
24868 if (_res_constr.datalen > 0)
24869 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
24871 _res_constr.data = NULL;
24872 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
24873 for (size_t t = 0; t < _res_constr.datalen; t++) {
24874 int64_t _res_conv_19 = _res_vals[t];
24875 LDKUpdateFulfillHTLC _res_conv_19_conv;
24876 _res_conv_19_conv.inner = untag_ptr(_res_conv_19);
24877 _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19);
24878 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv);
24879 _res_constr.data[t] = _res_conv_19_conv;
24881 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
24882 CVec_UpdateFulfillHTLCZ_free(_res_constr);
24885 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
24886 LDKCVec_UpdateFailHTLCZ _res_constr;
24887 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
24888 if (_res_constr.datalen > 0)
24889 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
24891 _res_constr.data = NULL;
24892 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
24893 for (size_t q = 0; q < _res_constr.datalen; q++) {
24894 int64_t _res_conv_16 = _res_vals[q];
24895 LDKUpdateFailHTLC _res_conv_16_conv;
24896 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
24897 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
24898 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
24899 _res_constr.data[q] = _res_conv_16_conv;
24901 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
24902 CVec_UpdateFailHTLCZ_free(_res_constr);
24905 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
24906 LDKCVec_UpdateFailMalformedHTLCZ _res_constr;
24907 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
24908 if (_res_constr.datalen > 0)
24909 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
24911 _res_constr.data = NULL;
24912 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
24913 for (size_t z = 0; z < _res_constr.datalen; z++) {
24914 int64_t _res_conv_25 = _res_vals[z];
24915 LDKUpdateFailMalformedHTLC _res_conv_25_conv;
24916 _res_conv_25_conv.inner = untag_ptr(_res_conv_25);
24917 _res_conv_25_conv.is_owned = ptr_is_owned(_res_conv_25);
24918 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_25_conv);
24919 _res_constr.data[z] = _res_conv_25_conv;
24921 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
24922 CVec_UpdateFailMalformedHTLCZ_free(_res_constr);
24925 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24926 LDKAcceptChannel o_conv;
24927 o_conv.inner = untag_ptr(o);
24928 o_conv.is_owned = ptr_is_owned(o);
24929 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24930 o_conv = AcceptChannel_clone(&o_conv);
24931 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
24932 *ret_conv = CResult_AcceptChannelDecodeErrorZ_ok(o_conv);
24933 return tag_ptr(ret_conv, true);
24936 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24937 void* e_ptr = untag_ptr(e);
24938 CHECK_ACCESS(e_ptr);
24939 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24940 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24941 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
24942 *ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv);
24943 return tag_ptr(ret_conv, true);
24946 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
24947 LDKCResult_AcceptChannelDecodeErrorZ* o_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(o);
24948 jboolean ret_conv = CResult_AcceptChannelDecodeErrorZ_is_ok(o_conv);
24952 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
24953 if (!ptr_is_owned(_res)) return;
24954 void* _res_ptr = untag_ptr(_res);
24955 CHECK_ACCESS(_res_ptr);
24956 LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(_res_ptr);
24957 FREE(untag_ptr(_res));
24958 CResult_AcceptChannelDecodeErrorZ_free(_res_conv);
24961 static inline uint64_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg) {
24962 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
24963 *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(arg);
24964 return tag_ptr(ret_conv, true);
24966 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
24967 LDKCResult_AcceptChannelDecodeErrorZ* arg_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(arg);
24968 int64_t ret_conv = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv);
24972 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
24973 LDKCResult_AcceptChannelDecodeErrorZ* orig_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(orig);
24974 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
24975 *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(orig_conv);
24976 return tag_ptr(ret_conv, true);
24979 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
24980 LDKAnnouncementSignatures o_conv;
24981 o_conv.inner = untag_ptr(o);
24982 o_conv.is_owned = ptr_is_owned(o);
24983 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
24984 o_conv = AnnouncementSignatures_clone(&o_conv);
24985 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
24986 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_ok(o_conv);
24987 return tag_ptr(ret_conv, true);
24990 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
24991 void* e_ptr = untag_ptr(e);
24992 CHECK_ACCESS(e_ptr);
24993 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
24994 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
24995 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
24996 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv);
24997 return tag_ptr(ret_conv, true);
25000 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25001 LDKCResult_AnnouncementSignaturesDecodeErrorZ* o_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(o);
25002 jboolean ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o_conv);
25006 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25007 if (!ptr_is_owned(_res)) return;
25008 void* _res_ptr = untag_ptr(_res);
25009 CHECK_ACCESS(_res_ptr);
25010 LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(_res_ptr);
25011 FREE(untag_ptr(_res));
25012 CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv);
25015 static inline uint64_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg) {
25016 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
25017 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(arg);
25018 return tag_ptr(ret_conv, true);
25020 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25021 LDKCResult_AnnouncementSignaturesDecodeErrorZ* arg_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(arg);
25022 int64_t ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv);
25026 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25027 LDKCResult_AnnouncementSignaturesDecodeErrorZ* orig_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(orig);
25028 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
25029 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(orig_conv);
25030 return tag_ptr(ret_conv, true);
25033 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25034 LDKChannelReestablish o_conv;
25035 o_conv.inner = untag_ptr(o);
25036 o_conv.is_owned = ptr_is_owned(o);
25037 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25038 o_conv = ChannelReestablish_clone(&o_conv);
25039 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
25040 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_ok(o_conv);
25041 return tag_ptr(ret_conv, true);
25044 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25045 void* e_ptr = untag_ptr(e);
25046 CHECK_ACCESS(e_ptr);
25047 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25048 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25049 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
25050 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv);
25051 return tag_ptr(ret_conv, true);
25054 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25055 LDKCResult_ChannelReestablishDecodeErrorZ* o_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(o);
25056 jboolean ret_conv = CResult_ChannelReestablishDecodeErrorZ_is_ok(o_conv);
25060 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25061 if (!ptr_is_owned(_res)) return;
25062 void* _res_ptr = untag_ptr(_res);
25063 CHECK_ACCESS(_res_ptr);
25064 LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(_res_ptr);
25065 FREE(untag_ptr(_res));
25066 CResult_ChannelReestablishDecodeErrorZ_free(_res_conv);
25069 static inline uint64_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg) {
25070 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
25071 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(arg);
25072 return tag_ptr(ret_conv, true);
25074 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25075 LDKCResult_ChannelReestablishDecodeErrorZ* arg_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(arg);
25076 int64_t ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv);
25080 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25081 LDKCResult_ChannelReestablishDecodeErrorZ* orig_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(orig);
25082 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
25083 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(orig_conv);
25084 return tag_ptr(ret_conv, true);
25087 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25088 LDKClosingSigned o_conv;
25089 o_conv.inner = untag_ptr(o);
25090 o_conv.is_owned = ptr_is_owned(o);
25091 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25092 o_conv = ClosingSigned_clone(&o_conv);
25093 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
25094 *ret_conv = CResult_ClosingSignedDecodeErrorZ_ok(o_conv);
25095 return tag_ptr(ret_conv, true);
25098 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25099 void* e_ptr = untag_ptr(e);
25100 CHECK_ACCESS(e_ptr);
25101 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25102 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25103 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
25104 *ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv);
25105 return tag_ptr(ret_conv, true);
25108 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25109 LDKCResult_ClosingSignedDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(o);
25110 jboolean ret_conv = CResult_ClosingSignedDecodeErrorZ_is_ok(o_conv);
25114 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25115 if (!ptr_is_owned(_res)) return;
25116 void* _res_ptr = untag_ptr(_res);
25117 CHECK_ACCESS(_res_ptr);
25118 LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(_res_ptr);
25119 FREE(untag_ptr(_res));
25120 CResult_ClosingSignedDecodeErrorZ_free(_res_conv);
25123 static inline uint64_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg) {
25124 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
25125 *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(arg);
25126 return tag_ptr(ret_conv, true);
25128 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25129 LDKCResult_ClosingSignedDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(arg);
25130 int64_t ret_conv = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv);
25134 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25135 LDKCResult_ClosingSignedDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(orig);
25136 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
25137 *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(orig_conv);
25138 return tag_ptr(ret_conv, true);
25141 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25142 LDKClosingSignedFeeRange o_conv;
25143 o_conv.inner = untag_ptr(o);
25144 o_conv.is_owned = ptr_is_owned(o);
25145 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25146 o_conv = ClosingSignedFeeRange_clone(&o_conv);
25147 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
25148 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o_conv);
25149 return tag_ptr(ret_conv, true);
25152 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25153 void* e_ptr = untag_ptr(e);
25154 CHECK_ACCESS(e_ptr);
25155 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25156 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25157 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
25158 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv);
25159 return tag_ptr(ret_conv, true);
25162 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25163 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(o);
25164 jboolean ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o_conv);
25168 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25169 if (!ptr_is_owned(_res)) return;
25170 void* _res_ptr = untag_ptr(_res);
25171 CHECK_ACCESS(_res_ptr);
25172 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(_res_ptr);
25173 FREE(untag_ptr(_res));
25174 CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv);
25177 static inline uint64_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg) {
25178 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
25179 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(arg);
25180 return tag_ptr(ret_conv, true);
25182 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25183 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(arg);
25184 int64_t ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv);
25188 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25189 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(orig);
25190 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
25191 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(orig_conv);
25192 return tag_ptr(ret_conv, true);
25195 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25196 LDKCommitmentSigned o_conv;
25197 o_conv.inner = untag_ptr(o);
25198 o_conv.is_owned = ptr_is_owned(o);
25199 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25200 o_conv = CommitmentSigned_clone(&o_conv);
25201 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
25202 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_ok(o_conv);
25203 return tag_ptr(ret_conv, true);
25206 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25207 void* e_ptr = untag_ptr(e);
25208 CHECK_ACCESS(e_ptr);
25209 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25210 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25211 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
25212 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv);
25213 return tag_ptr(ret_conv, true);
25216 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25217 LDKCResult_CommitmentSignedDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(o);
25218 jboolean ret_conv = CResult_CommitmentSignedDecodeErrorZ_is_ok(o_conv);
25222 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25223 if (!ptr_is_owned(_res)) return;
25224 void* _res_ptr = untag_ptr(_res);
25225 CHECK_ACCESS(_res_ptr);
25226 LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(_res_ptr);
25227 FREE(untag_ptr(_res));
25228 CResult_CommitmentSignedDecodeErrorZ_free(_res_conv);
25231 static inline uint64_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg) {
25232 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
25233 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(arg);
25234 return tag_ptr(ret_conv, true);
25236 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25237 LDKCResult_CommitmentSignedDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(arg);
25238 int64_t ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv);
25242 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25243 LDKCResult_CommitmentSignedDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(orig);
25244 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
25245 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(orig_conv);
25246 return tag_ptr(ret_conv, true);
25249 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25250 LDKFundingCreated o_conv;
25251 o_conv.inner = untag_ptr(o);
25252 o_conv.is_owned = ptr_is_owned(o);
25253 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25254 o_conv = FundingCreated_clone(&o_conv);
25255 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
25256 *ret_conv = CResult_FundingCreatedDecodeErrorZ_ok(o_conv);
25257 return tag_ptr(ret_conv, true);
25260 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25261 void* e_ptr = untag_ptr(e);
25262 CHECK_ACCESS(e_ptr);
25263 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25264 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25265 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
25266 *ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv);
25267 return tag_ptr(ret_conv, true);
25270 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25271 LDKCResult_FundingCreatedDecodeErrorZ* o_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(o);
25272 jboolean ret_conv = CResult_FundingCreatedDecodeErrorZ_is_ok(o_conv);
25276 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25277 if (!ptr_is_owned(_res)) return;
25278 void* _res_ptr = untag_ptr(_res);
25279 CHECK_ACCESS(_res_ptr);
25280 LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(_res_ptr);
25281 FREE(untag_ptr(_res));
25282 CResult_FundingCreatedDecodeErrorZ_free(_res_conv);
25285 static inline uint64_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg) {
25286 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
25287 *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(arg);
25288 return tag_ptr(ret_conv, true);
25290 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25291 LDKCResult_FundingCreatedDecodeErrorZ* arg_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(arg);
25292 int64_t ret_conv = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv);
25296 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25297 LDKCResult_FundingCreatedDecodeErrorZ* orig_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(orig);
25298 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
25299 *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(orig_conv);
25300 return tag_ptr(ret_conv, true);
25303 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25304 LDKFundingSigned o_conv;
25305 o_conv.inner = untag_ptr(o);
25306 o_conv.is_owned = ptr_is_owned(o);
25307 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25308 o_conv = FundingSigned_clone(&o_conv);
25309 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
25310 *ret_conv = CResult_FundingSignedDecodeErrorZ_ok(o_conv);
25311 return tag_ptr(ret_conv, true);
25314 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25315 void* e_ptr = untag_ptr(e);
25316 CHECK_ACCESS(e_ptr);
25317 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25318 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25319 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
25320 *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv);
25321 return tag_ptr(ret_conv, true);
25324 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25325 LDKCResult_FundingSignedDecodeErrorZ* o_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(o);
25326 jboolean ret_conv = CResult_FundingSignedDecodeErrorZ_is_ok(o_conv);
25330 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25331 if (!ptr_is_owned(_res)) return;
25332 void* _res_ptr = untag_ptr(_res);
25333 CHECK_ACCESS(_res_ptr);
25334 LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(_res_ptr);
25335 FREE(untag_ptr(_res));
25336 CResult_FundingSignedDecodeErrorZ_free(_res_conv);
25339 static inline uint64_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg) {
25340 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
25341 *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(arg);
25342 return tag_ptr(ret_conv, true);
25344 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25345 LDKCResult_FundingSignedDecodeErrorZ* arg_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(arg);
25346 int64_t ret_conv = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv);
25350 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25351 LDKCResult_FundingSignedDecodeErrorZ* orig_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(orig);
25352 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
25353 *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(orig_conv);
25354 return tag_ptr(ret_conv, true);
25357 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25358 LDKChannelReady o_conv;
25359 o_conv.inner = untag_ptr(o);
25360 o_conv.is_owned = ptr_is_owned(o);
25361 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25362 o_conv = ChannelReady_clone(&o_conv);
25363 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
25364 *ret_conv = CResult_ChannelReadyDecodeErrorZ_ok(o_conv);
25365 return tag_ptr(ret_conv, true);
25368 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25369 void* e_ptr = untag_ptr(e);
25370 CHECK_ACCESS(e_ptr);
25371 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25372 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25373 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
25374 *ret_conv = CResult_ChannelReadyDecodeErrorZ_err(e_conv);
25375 return tag_ptr(ret_conv, true);
25378 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25379 LDKCResult_ChannelReadyDecodeErrorZ* o_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(o);
25380 jboolean ret_conv = CResult_ChannelReadyDecodeErrorZ_is_ok(o_conv);
25384 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25385 if (!ptr_is_owned(_res)) return;
25386 void* _res_ptr = untag_ptr(_res);
25387 CHECK_ACCESS(_res_ptr);
25388 LDKCResult_ChannelReadyDecodeErrorZ _res_conv = *(LDKCResult_ChannelReadyDecodeErrorZ*)(_res_ptr);
25389 FREE(untag_ptr(_res));
25390 CResult_ChannelReadyDecodeErrorZ_free(_res_conv);
25393 static inline uint64_t CResult_ChannelReadyDecodeErrorZ_clone_ptr(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR arg) {
25394 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
25395 *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(arg);
25396 return tag_ptr(ret_conv, true);
25398 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25399 LDKCResult_ChannelReadyDecodeErrorZ* arg_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(arg);
25400 int64_t ret_conv = CResult_ChannelReadyDecodeErrorZ_clone_ptr(arg_conv);
25404 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25405 LDKCResult_ChannelReadyDecodeErrorZ* orig_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(orig);
25406 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
25407 *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(orig_conv);
25408 return tag_ptr(ret_conv, true);
25411 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25413 o_conv.inner = untag_ptr(o);
25414 o_conv.is_owned = ptr_is_owned(o);
25415 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25416 o_conv = Init_clone(&o_conv);
25417 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
25418 *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv);
25419 return tag_ptr(ret_conv, true);
25422 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25423 void* e_ptr = untag_ptr(e);
25424 CHECK_ACCESS(e_ptr);
25425 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25426 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25427 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
25428 *ret_conv = CResult_InitDecodeErrorZ_err(e_conv);
25429 return tag_ptr(ret_conv, true);
25432 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25433 LDKCResult_InitDecodeErrorZ* o_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(o);
25434 jboolean ret_conv = CResult_InitDecodeErrorZ_is_ok(o_conv);
25438 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25439 if (!ptr_is_owned(_res)) return;
25440 void* _res_ptr = untag_ptr(_res);
25441 CHECK_ACCESS(_res_ptr);
25442 LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(_res_ptr);
25443 FREE(untag_ptr(_res));
25444 CResult_InitDecodeErrorZ_free(_res_conv);
25447 static inline uint64_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg) {
25448 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
25449 *ret_conv = CResult_InitDecodeErrorZ_clone(arg);
25450 return tag_ptr(ret_conv, true);
25452 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25453 LDKCResult_InitDecodeErrorZ* arg_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(arg);
25454 int64_t ret_conv = CResult_InitDecodeErrorZ_clone_ptr(arg_conv);
25458 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25459 LDKCResult_InitDecodeErrorZ* orig_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(orig);
25460 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
25461 *ret_conv = CResult_InitDecodeErrorZ_clone(orig_conv);
25462 return tag_ptr(ret_conv, true);
25465 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25466 LDKOpenChannel o_conv;
25467 o_conv.inner = untag_ptr(o);
25468 o_conv.is_owned = ptr_is_owned(o);
25469 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25470 o_conv = OpenChannel_clone(&o_conv);
25471 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
25472 *ret_conv = CResult_OpenChannelDecodeErrorZ_ok(o_conv);
25473 return tag_ptr(ret_conv, true);
25476 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25477 void* e_ptr = untag_ptr(e);
25478 CHECK_ACCESS(e_ptr);
25479 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25480 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25481 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
25482 *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv);
25483 return tag_ptr(ret_conv, true);
25486 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25487 LDKCResult_OpenChannelDecodeErrorZ* o_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(o);
25488 jboolean ret_conv = CResult_OpenChannelDecodeErrorZ_is_ok(o_conv);
25492 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25493 if (!ptr_is_owned(_res)) return;
25494 void* _res_ptr = untag_ptr(_res);
25495 CHECK_ACCESS(_res_ptr);
25496 LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(_res_ptr);
25497 FREE(untag_ptr(_res));
25498 CResult_OpenChannelDecodeErrorZ_free(_res_conv);
25501 static inline uint64_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg) {
25502 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
25503 *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(arg);
25504 return tag_ptr(ret_conv, true);
25506 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25507 LDKCResult_OpenChannelDecodeErrorZ* arg_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(arg);
25508 int64_t ret_conv = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv);
25512 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25513 LDKCResult_OpenChannelDecodeErrorZ* orig_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(orig);
25514 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
25515 *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(orig_conv);
25516 return tag_ptr(ret_conv, true);
25519 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25520 LDKRevokeAndACK o_conv;
25521 o_conv.inner = untag_ptr(o);
25522 o_conv.is_owned = ptr_is_owned(o);
25523 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25524 o_conv = RevokeAndACK_clone(&o_conv);
25525 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
25526 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_ok(o_conv);
25527 return tag_ptr(ret_conv, true);
25530 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25531 void* e_ptr = untag_ptr(e);
25532 CHECK_ACCESS(e_ptr);
25533 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25534 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25535 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
25536 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv);
25537 return tag_ptr(ret_conv, true);
25540 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25541 LDKCResult_RevokeAndACKDecodeErrorZ* o_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(o);
25542 jboolean ret_conv = CResult_RevokeAndACKDecodeErrorZ_is_ok(o_conv);
25546 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25547 if (!ptr_is_owned(_res)) return;
25548 void* _res_ptr = untag_ptr(_res);
25549 CHECK_ACCESS(_res_ptr);
25550 LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(_res_ptr);
25551 FREE(untag_ptr(_res));
25552 CResult_RevokeAndACKDecodeErrorZ_free(_res_conv);
25555 static inline uint64_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg) {
25556 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
25557 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(arg);
25558 return tag_ptr(ret_conv, true);
25560 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25561 LDKCResult_RevokeAndACKDecodeErrorZ* arg_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(arg);
25562 int64_t ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv);
25566 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25567 LDKCResult_RevokeAndACKDecodeErrorZ* orig_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(orig);
25568 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
25569 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(orig_conv);
25570 return tag_ptr(ret_conv, true);
25573 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25574 LDKShutdown o_conv;
25575 o_conv.inner = untag_ptr(o);
25576 o_conv.is_owned = ptr_is_owned(o);
25577 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25578 o_conv = Shutdown_clone(&o_conv);
25579 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
25580 *ret_conv = CResult_ShutdownDecodeErrorZ_ok(o_conv);
25581 return tag_ptr(ret_conv, true);
25584 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25585 void* e_ptr = untag_ptr(e);
25586 CHECK_ACCESS(e_ptr);
25587 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25588 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25589 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
25590 *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv);
25591 return tag_ptr(ret_conv, true);
25594 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25595 LDKCResult_ShutdownDecodeErrorZ* o_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(o);
25596 jboolean ret_conv = CResult_ShutdownDecodeErrorZ_is_ok(o_conv);
25600 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25601 if (!ptr_is_owned(_res)) return;
25602 void* _res_ptr = untag_ptr(_res);
25603 CHECK_ACCESS(_res_ptr);
25604 LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(_res_ptr);
25605 FREE(untag_ptr(_res));
25606 CResult_ShutdownDecodeErrorZ_free(_res_conv);
25609 static inline uint64_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg) {
25610 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
25611 *ret_conv = CResult_ShutdownDecodeErrorZ_clone(arg);
25612 return tag_ptr(ret_conv, true);
25614 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25615 LDKCResult_ShutdownDecodeErrorZ* arg_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(arg);
25616 int64_t ret_conv = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv);
25620 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25621 LDKCResult_ShutdownDecodeErrorZ* orig_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(orig);
25622 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
25623 *ret_conv = CResult_ShutdownDecodeErrorZ_clone(orig_conv);
25624 return tag_ptr(ret_conv, true);
25627 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25628 LDKUpdateFailHTLC o_conv;
25629 o_conv.inner = untag_ptr(o);
25630 o_conv.is_owned = ptr_is_owned(o);
25631 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25632 o_conv = UpdateFailHTLC_clone(&o_conv);
25633 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
25634 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_ok(o_conv);
25635 return tag_ptr(ret_conv, true);
25638 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25639 void* e_ptr = untag_ptr(e);
25640 CHECK_ACCESS(e_ptr);
25641 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25642 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25643 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
25644 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv);
25645 return tag_ptr(ret_conv, true);
25648 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25649 LDKCResult_UpdateFailHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(o);
25650 jboolean ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_is_ok(o_conv);
25654 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25655 if (!ptr_is_owned(_res)) return;
25656 void* _res_ptr = untag_ptr(_res);
25657 CHECK_ACCESS(_res_ptr);
25658 LDKCResult_UpdateFailHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailHTLCDecodeErrorZ*)(_res_ptr);
25659 FREE(untag_ptr(_res));
25660 CResult_UpdateFailHTLCDecodeErrorZ_free(_res_conv);
25663 static inline uint64_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg) {
25664 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
25665 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(arg);
25666 return tag_ptr(ret_conv, true);
25668 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25669 LDKCResult_UpdateFailHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(arg);
25670 int64_t ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg_conv);
25674 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25675 LDKCResult_UpdateFailHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(orig);
25676 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
25677 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(orig_conv);
25678 return tag_ptr(ret_conv, true);
25681 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25682 LDKUpdateFailMalformedHTLC o_conv;
25683 o_conv.inner = untag_ptr(o);
25684 o_conv.is_owned = ptr_is_owned(o);
25685 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25686 o_conv = UpdateFailMalformedHTLC_clone(&o_conv);
25687 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
25688 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o_conv);
25689 return tag_ptr(ret_conv, true);
25692 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25693 void* e_ptr = untag_ptr(e);
25694 CHECK_ACCESS(e_ptr);
25695 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25696 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25697 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
25698 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv);
25699 return tag_ptr(ret_conv, true);
25702 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25703 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(o);
25704 jboolean ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(o_conv);
25708 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25709 if (!ptr_is_owned(_res)) return;
25710 void* _res_ptr = untag_ptr(_res);
25711 CHECK_ACCESS(_res_ptr);
25712 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(_res_ptr);
25713 FREE(untag_ptr(_res));
25714 CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res_conv);
25717 static inline uint64_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg) {
25718 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
25719 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(arg);
25720 return tag_ptr(ret_conv, true);
25722 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25723 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(arg);
25724 int64_t ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg_conv);
25728 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25729 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(orig);
25730 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
25731 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(orig_conv);
25732 return tag_ptr(ret_conv, true);
25735 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25736 LDKUpdateFee o_conv;
25737 o_conv.inner = untag_ptr(o);
25738 o_conv.is_owned = ptr_is_owned(o);
25739 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25740 o_conv = UpdateFee_clone(&o_conv);
25741 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
25742 *ret_conv = CResult_UpdateFeeDecodeErrorZ_ok(o_conv);
25743 return tag_ptr(ret_conv, true);
25746 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25747 void* e_ptr = untag_ptr(e);
25748 CHECK_ACCESS(e_ptr);
25749 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25750 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25751 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
25752 *ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv);
25753 return tag_ptr(ret_conv, true);
25756 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25757 LDKCResult_UpdateFeeDecodeErrorZ* o_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(o);
25758 jboolean ret_conv = CResult_UpdateFeeDecodeErrorZ_is_ok(o_conv);
25762 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25763 if (!ptr_is_owned(_res)) return;
25764 void* _res_ptr = untag_ptr(_res);
25765 CHECK_ACCESS(_res_ptr);
25766 LDKCResult_UpdateFeeDecodeErrorZ _res_conv = *(LDKCResult_UpdateFeeDecodeErrorZ*)(_res_ptr);
25767 FREE(untag_ptr(_res));
25768 CResult_UpdateFeeDecodeErrorZ_free(_res_conv);
25771 static inline uint64_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg) {
25772 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
25773 *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(arg);
25774 return tag_ptr(ret_conv, true);
25776 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25777 LDKCResult_UpdateFeeDecodeErrorZ* arg_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(arg);
25778 int64_t ret_conv = CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg_conv);
25782 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25783 LDKCResult_UpdateFeeDecodeErrorZ* orig_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(orig);
25784 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
25785 *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(orig_conv);
25786 return tag_ptr(ret_conv, true);
25789 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25790 LDKUpdateFulfillHTLC o_conv;
25791 o_conv.inner = untag_ptr(o);
25792 o_conv.is_owned = ptr_is_owned(o);
25793 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25794 o_conv = UpdateFulfillHTLC_clone(&o_conv);
25795 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
25796 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o_conv);
25797 return tag_ptr(ret_conv, true);
25800 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25801 void* e_ptr = untag_ptr(e);
25802 CHECK_ACCESS(e_ptr);
25803 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25804 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25805 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
25806 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv);
25807 return tag_ptr(ret_conv, true);
25810 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25811 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(o);
25812 jboolean ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(o_conv);
25816 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25817 if (!ptr_is_owned(_res)) return;
25818 void* _res_ptr = untag_ptr(_res);
25819 CHECK_ACCESS(_res_ptr);
25820 LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(_res_ptr);
25821 FREE(untag_ptr(_res));
25822 CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res_conv);
25825 static inline uint64_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg) {
25826 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
25827 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(arg);
25828 return tag_ptr(ret_conv, true);
25830 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25831 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(arg);
25832 int64_t ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg_conv);
25836 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25837 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(orig);
25838 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
25839 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(orig_conv);
25840 return tag_ptr(ret_conv, true);
25843 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25844 LDKUpdateAddHTLC o_conv;
25845 o_conv.inner = untag_ptr(o);
25846 o_conv.is_owned = ptr_is_owned(o);
25847 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25848 o_conv = UpdateAddHTLC_clone(&o_conv);
25849 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
25850 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_ok(o_conv);
25851 return tag_ptr(ret_conv, true);
25854 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25855 void* e_ptr = untag_ptr(e);
25856 CHECK_ACCESS(e_ptr);
25857 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25858 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25859 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
25860 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv);
25861 return tag_ptr(ret_conv, true);
25864 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25865 LDKCResult_UpdateAddHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(o);
25866 jboolean ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_is_ok(o_conv);
25870 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25871 if (!ptr_is_owned(_res)) return;
25872 void* _res_ptr = untag_ptr(_res);
25873 CHECK_ACCESS(_res_ptr);
25874 LDKCResult_UpdateAddHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateAddHTLCDecodeErrorZ*)(_res_ptr);
25875 FREE(untag_ptr(_res));
25876 CResult_UpdateAddHTLCDecodeErrorZ_free(_res_conv);
25879 static inline uint64_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg) {
25880 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
25881 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(arg);
25882 return tag_ptr(ret_conv, true);
25884 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25885 LDKCResult_UpdateAddHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(arg);
25886 int64_t ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg_conv);
25890 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25891 LDKCResult_UpdateAddHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(orig);
25892 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
25893 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(orig_conv);
25894 return tag_ptr(ret_conv, true);
25897 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25898 LDKOnionMessage o_conv;
25899 o_conv.inner = untag_ptr(o);
25900 o_conv.is_owned = ptr_is_owned(o);
25901 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25902 o_conv = OnionMessage_clone(&o_conv);
25903 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
25904 *ret_conv = CResult_OnionMessageDecodeErrorZ_ok(o_conv);
25905 return tag_ptr(ret_conv, true);
25908 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25909 void* e_ptr = untag_ptr(e);
25910 CHECK_ACCESS(e_ptr);
25911 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25912 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25913 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
25914 *ret_conv = CResult_OnionMessageDecodeErrorZ_err(e_conv);
25915 return tag_ptr(ret_conv, true);
25918 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25919 LDKCResult_OnionMessageDecodeErrorZ* o_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(o);
25920 jboolean ret_conv = CResult_OnionMessageDecodeErrorZ_is_ok(o_conv);
25924 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25925 if (!ptr_is_owned(_res)) return;
25926 void* _res_ptr = untag_ptr(_res);
25927 CHECK_ACCESS(_res_ptr);
25928 LDKCResult_OnionMessageDecodeErrorZ _res_conv = *(LDKCResult_OnionMessageDecodeErrorZ*)(_res_ptr);
25929 FREE(untag_ptr(_res));
25930 CResult_OnionMessageDecodeErrorZ_free(_res_conv);
25933 static inline uint64_t CResult_OnionMessageDecodeErrorZ_clone_ptr(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR arg) {
25934 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
25935 *ret_conv = CResult_OnionMessageDecodeErrorZ_clone(arg);
25936 return tag_ptr(ret_conv, true);
25938 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25939 LDKCResult_OnionMessageDecodeErrorZ* arg_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(arg);
25940 int64_t ret_conv = CResult_OnionMessageDecodeErrorZ_clone_ptr(arg_conv);
25944 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25945 LDKCResult_OnionMessageDecodeErrorZ* orig_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(orig);
25946 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
25947 *ret_conv = CResult_OnionMessageDecodeErrorZ_clone(orig_conv);
25948 return tag_ptr(ret_conv, true);
25951 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
25953 o_conv.inner = untag_ptr(o);
25954 o_conv.is_owned = ptr_is_owned(o);
25955 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
25956 o_conv = Ping_clone(&o_conv);
25957 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
25958 *ret_conv = CResult_PingDecodeErrorZ_ok(o_conv);
25959 return tag_ptr(ret_conv, true);
25962 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
25963 void* e_ptr = untag_ptr(e);
25964 CHECK_ACCESS(e_ptr);
25965 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
25966 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
25967 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
25968 *ret_conv = CResult_PingDecodeErrorZ_err(e_conv);
25969 return tag_ptr(ret_conv, true);
25972 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
25973 LDKCResult_PingDecodeErrorZ* o_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(o);
25974 jboolean ret_conv = CResult_PingDecodeErrorZ_is_ok(o_conv);
25978 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
25979 if (!ptr_is_owned(_res)) return;
25980 void* _res_ptr = untag_ptr(_res);
25981 CHECK_ACCESS(_res_ptr);
25982 LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)(_res_ptr);
25983 FREE(untag_ptr(_res));
25984 CResult_PingDecodeErrorZ_free(_res_conv);
25987 static inline uint64_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg) {
25988 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
25989 *ret_conv = CResult_PingDecodeErrorZ_clone(arg);
25990 return tag_ptr(ret_conv, true);
25992 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
25993 LDKCResult_PingDecodeErrorZ* arg_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(arg);
25994 int64_t ret_conv = CResult_PingDecodeErrorZ_clone_ptr(arg_conv);
25998 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
25999 LDKCResult_PingDecodeErrorZ* orig_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(orig);
26000 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
26001 *ret_conv = CResult_PingDecodeErrorZ_clone(orig_conv);
26002 return tag_ptr(ret_conv, true);
26005 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
26007 o_conv.inner = untag_ptr(o);
26008 o_conv.is_owned = ptr_is_owned(o);
26009 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
26010 o_conv = Pong_clone(&o_conv);
26011 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
26012 *ret_conv = CResult_PongDecodeErrorZ_ok(o_conv);
26013 return tag_ptr(ret_conv, true);
26016 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
26017 void* e_ptr = untag_ptr(e);
26018 CHECK_ACCESS(e_ptr);
26019 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
26020 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
26021 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
26022 *ret_conv = CResult_PongDecodeErrorZ_err(e_conv);
26023 return tag_ptr(ret_conv, true);
26026 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
26027 LDKCResult_PongDecodeErrorZ* o_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(o);
26028 jboolean ret_conv = CResult_PongDecodeErrorZ_is_ok(o_conv);
26032 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26033 if (!ptr_is_owned(_res)) return;
26034 void* _res_ptr = untag_ptr(_res);
26035 CHECK_ACCESS(_res_ptr);
26036 LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)(_res_ptr);
26037 FREE(untag_ptr(_res));
26038 CResult_PongDecodeErrorZ_free(_res_conv);
26041 static inline uint64_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg) {
26042 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
26043 *ret_conv = CResult_PongDecodeErrorZ_clone(arg);
26044 return tag_ptr(ret_conv, true);
26046 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26047 LDKCResult_PongDecodeErrorZ* arg_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(arg);
26048 int64_t ret_conv = CResult_PongDecodeErrorZ_clone_ptr(arg_conv);
26052 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26053 LDKCResult_PongDecodeErrorZ* orig_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(orig);
26054 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
26055 *ret_conv = CResult_PongDecodeErrorZ_clone(orig_conv);
26056 return tag_ptr(ret_conv, true);
26059 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
26060 LDKUnsignedChannelAnnouncement o_conv;
26061 o_conv.inner = untag_ptr(o);
26062 o_conv.is_owned = ptr_is_owned(o);
26063 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
26064 o_conv = UnsignedChannelAnnouncement_clone(&o_conv);
26065 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
26066 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o_conv);
26067 return tag_ptr(ret_conv, true);
26070 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
26071 void* e_ptr = untag_ptr(e);
26072 CHECK_ACCESS(e_ptr);
26073 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
26074 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
26075 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
26076 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv);
26077 return tag_ptr(ret_conv, true);
26080 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
26081 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(o);
26082 jboolean ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
26086 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26087 if (!ptr_is_owned(_res)) return;
26088 void* _res_ptr = untag_ptr(_res);
26089 CHECK_ACCESS(_res_ptr);
26090 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(_res_ptr);
26091 FREE(untag_ptr(_res));
26092 CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv);
26095 static inline uint64_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
26096 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
26097 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(arg);
26098 return tag_ptr(ret_conv, true);
26100 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26101 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(arg);
26102 int64_t ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
26106 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26107 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(orig);
26108 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
26109 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(orig_conv);
26110 return tag_ptr(ret_conv, true);
26113 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
26114 LDKChannelAnnouncement o_conv;
26115 o_conv.inner = untag_ptr(o);
26116 o_conv.is_owned = ptr_is_owned(o);
26117 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
26118 o_conv = ChannelAnnouncement_clone(&o_conv);
26119 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
26120 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_ok(o_conv);
26121 return tag_ptr(ret_conv, true);
26124 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
26125 void* e_ptr = untag_ptr(e);
26126 CHECK_ACCESS(e_ptr);
26127 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
26128 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
26129 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
26130 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv);
26131 return tag_ptr(ret_conv, true);
26134 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
26135 LDKCResult_ChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(o);
26136 jboolean ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
26140 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26141 if (!ptr_is_owned(_res)) return;
26142 void* _res_ptr = untag_ptr(_res);
26143 CHECK_ACCESS(_res_ptr);
26144 LDKCResult_ChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_ChannelAnnouncementDecodeErrorZ*)(_res_ptr);
26145 FREE(untag_ptr(_res));
26146 CResult_ChannelAnnouncementDecodeErrorZ_free(_res_conv);
26149 static inline uint64_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
26150 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
26151 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(arg);
26152 return tag_ptr(ret_conv, true);
26154 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26155 LDKCResult_ChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(arg);
26156 int64_t ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
26160 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26161 LDKCResult_ChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(orig);
26162 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
26163 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(orig_conv);
26164 return tag_ptr(ret_conv, true);
26167 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
26168 LDKUnsignedChannelUpdate o_conv;
26169 o_conv.inner = untag_ptr(o);
26170 o_conv.is_owned = ptr_is_owned(o);
26171 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
26172 o_conv = UnsignedChannelUpdate_clone(&o_conv);
26173 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
26174 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o_conv);
26175 return tag_ptr(ret_conv, true);
26178 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
26179 void* e_ptr = untag_ptr(e);
26180 CHECK_ACCESS(e_ptr);
26181 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
26182 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
26183 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
26184 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv);
26185 return tag_ptr(ret_conv, true);
26188 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
26189 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(o);
26190 jboolean ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(o_conv);
26194 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26195 if (!ptr_is_owned(_res)) return;
26196 void* _res_ptr = untag_ptr(_res);
26197 CHECK_ACCESS(_res_ptr);
26198 LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(_res_ptr);
26199 FREE(untag_ptr(_res));
26200 CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv);
26203 static inline uint64_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
26204 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
26205 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(arg);
26206 return tag_ptr(ret_conv, true);
26208 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26209 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(arg);
26210 int64_t ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
26214 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26215 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(orig);
26216 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
26217 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(orig_conv);
26218 return tag_ptr(ret_conv, true);
26221 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
26222 LDKChannelUpdate o_conv;
26223 o_conv.inner = untag_ptr(o);
26224 o_conv.is_owned = ptr_is_owned(o);
26225 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
26226 o_conv = ChannelUpdate_clone(&o_conv);
26227 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
26228 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_ok(o_conv);
26229 return tag_ptr(ret_conv, true);
26232 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
26233 void* e_ptr = untag_ptr(e);
26234 CHECK_ACCESS(e_ptr);
26235 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
26236 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
26237 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
26238 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv);
26239 return tag_ptr(ret_conv, true);
26242 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
26243 LDKCResult_ChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(o);
26244 jboolean ret_conv = CResult_ChannelUpdateDecodeErrorZ_is_ok(o_conv);
26248 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26249 if (!ptr_is_owned(_res)) return;
26250 void* _res_ptr = untag_ptr(_res);
26251 CHECK_ACCESS(_res_ptr);
26252 LDKCResult_ChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateDecodeErrorZ*)(_res_ptr);
26253 FREE(untag_ptr(_res));
26254 CResult_ChannelUpdateDecodeErrorZ_free(_res_conv);
26257 static inline uint64_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
26258 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
26259 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(arg);
26260 return tag_ptr(ret_conv, true);
26262 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26263 LDKCResult_ChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(arg);
26264 int64_t ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
26268 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26269 LDKCResult_ChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(orig);
26270 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
26271 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(orig_conv);
26272 return tag_ptr(ret_conv, true);
26275 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
26276 LDKErrorMessage o_conv;
26277 o_conv.inner = untag_ptr(o);
26278 o_conv.is_owned = ptr_is_owned(o);
26279 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
26280 o_conv = ErrorMessage_clone(&o_conv);
26281 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
26282 *ret_conv = CResult_ErrorMessageDecodeErrorZ_ok(o_conv);
26283 return tag_ptr(ret_conv, true);
26286 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
26287 void* e_ptr = untag_ptr(e);
26288 CHECK_ACCESS(e_ptr);
26289 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
26290 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
26291 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
26292 *ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv);
26293 return tag_ptr(ret_conv, true);
26296 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
26297 LDKCResult_ErrorMessageDecodeErrorZ* o_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(o);
26298 jboolean ret_conv = CResult_ErrorMessageDecodeErrorZ_is_ok(o_conv);
26302 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26303 if (!ptr_is_owned(_res)) return;
26304 void* _res_ptr = untag_ptr(_res);
26305 CHECK_ACCESS(_res_ptr);
26306 LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)(_res_ptr);
26307 FREE(untag_ptr(_res));
26308 CResult_ErrorMessageDecodeErrorZ_free(_res_conv);
26311 static inline uint64_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg) {
26312 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
26313 *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(arg);
26314 return tag_ptr(ret_conv, true);
26316 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26317 LDKCResult_ErrorMessageDecodeErrorZ* arg_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(arg);
26318 int64_t ret_conv = CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg_conv);
26322 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26323 LDKCResult_ErrorMessageDecodeErrorZ* orig_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(orig);
26324 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
26325 *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(orig_conv);
26326 return tag_ptr(ret_conv, true);
26329 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
26330 LDKWarningMessage o_conv;
26331 o_conv.inner = untag_ptr(o);
26332 o_conv.is_owned = ptr_is_owned(o);
26333 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
26334 o_conv = WarningMessage_clone(&o_conv);
26335 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
26336 *ret_conv = CResult_WarningMessageDecodeErrorZ_ok(o_conv);
26337 return tag_ptr(ret_conv, true);
26340 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
26341 void* e_ptr = untag_ptr(e);
26342 CHECK_ACCESS(e_ptr);
26343 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
26344 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
26345 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
26346 *ret_conv = CResult_WarningMessageDecodeErrorZ_err(e_conv);
26347 return tag_ptr(ret_conv, true);
26350 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
26351 LDKCResult_WarningMessageDecodeErrorZ* o_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(o);
26352 jboolean ret_conv = CResult_WarningMessageDecodeErrorZ_is_ok(o_conv);
26356 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26357 if (!ptr_is_owned(_res)) return;
26358 void* _res_ptr = untag_ptr(_res);
26359 CHECK_ACCESS(_res_ptr);
26360 LDKCResult_WarningMessageDecodeErrorZ _res_conv = *(LDKCResult_WarningMessageDecodeErrorZ*)(_res_ptr);
26361 FREE(untag_ptr(_res));
26362 CResult_WarningMessageDecodeErrorZ_free(_res_conv);
26365 static inline uint64_t CResult_WarningMessageDecodeErrorZ_clone_ptr(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR arg) {
26366 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
26367 *ret_conv = CResult_WarningMessageDecodeErrorZ_clone(arg);
26368 return tag_ptr(ret_conv, true);
26370 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26371 LDKCResult_WarningMessageDecodeErrorZ* arg_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(arg);
26372 int64_t ret_conv = CResult_WarningMessageDecodeErrorZ_clone_ptr(arg_conv);
26376 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26377 LDKCResult_WarningMessageDecodeErrorZ* orig_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(orig);
26378 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
26379 *ret_conv = CResult_WarningMessageDecodeErrorZ_clone(orig_conv);
26380 return tag_ptr(ret_conv, true);
26383 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
26384 LDKUnsignedNodeAnnouncement o_conv;
26385 o_conv.inner = untag_ptr(o);
26386 o_conv.is_owned = ptr_is_owned(o);
26387 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
26388 o_conv = UnsignedNodeAnnouncement_clone(&o_conv);
26389 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
26390 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o_conv);
26391 return tag_ptr(ret_conv, true);
26394 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
26395 void* e_ptr = untag_ptr(e);
26396 CHECK_ACCESS(e_ptr);
26397 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
26398 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
26399 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
26400 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv);
26401 return tag_ptr(ret_conv, true);
26404 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
26405 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(o);
26406 jboolean ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(o_conv);
26410 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26411 if (!ptr_is_owned(_res)) return;
26412 void* _res_ptr = untag_ptr(_res);
26413 CHECK_ACCESS(_res_ptr);
26414 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(_res_ptr);
26415 FREE(untag_ptr(_res));
26416 CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv);
26419 static inline uint64_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
26420 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
26421 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(arg);
26422 return tag_ptr(ret_conv, true);
26424 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26425 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(arg);
26426 int64_t ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
26430 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26431 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(orig);
26432 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
26433 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(orig_conv);
26434 return tag_ptr(ret_conv, true);
26437 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
26438 LDKNodeAnnouncement o_conv;
26439 o_conv.inner = untag_ptr(o);
26440 o_conv.is_owned = ptr_is_owned(o);
26441 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
26442 o_conv = NodeAnnouncement_clone(&o_conv);
26443 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
26444 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_ok(o_conv);
26445 return tag_ptr(ret_conv, true);
26448 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
26449 void* e_ptr = untag_ptr(e);
26450 CHECK_ACCESS(e_ptr);
26451 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
26452 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
26453 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
26454 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv);
26455 return tag_ptr(ret_conv, true);
26458 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
26459 LDKCResult_NodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(o);
26460 jboolean ret_conv = CResult_NodeAnnouncementDecodeErrorZ_is_ok(o_conv);
26464 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26465 if (!ptr_is_owned(_res)) return;
26466 void* _res_ptr = untag_ptr(_res);
26467 CHECK_ACCESS(_res_ptr);
26468 LDKCResult_NodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementDecodeErrorZ*)(_res_ptr);
26469 FREE(untag_ptr(_res));
26470 CResult_NodeAnnouncementDecodeErrorZ_free(_res_conv);
26473 static inline uint64_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
26474 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
26475 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(arg);
26476 return tag_ptr(ret_conv, true);
26478 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26479 LDKCResult_NodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(arg);
26480 int64_t ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
26484 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26485 LDKCResult_NodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(orig);
26486 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
26487 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(orig_conv);
26488 return tag_ptr(ret_conv, true);
26491 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
26492 LDKQueryShortChannelIds o_conv;
26493 o_conv.inner = untag_ptr(o);
26494 o_conv.is_owned = ptr_is_owned(o);
26495 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
26496 o_conv = QueryShortChannelIds_clone(&o_conv);
26497 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
26498 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_ok(o_conv);
26499 return tag_ptr(ret_conv, true);
26502 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
26503 void* e_ptr = untag_ptr(e);
26504 CHECK_ACCESS(e_ptr);
26505 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
26506 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
26507 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
26508 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv);
26509 return tag_ptr(ret_conv, true);
26512 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
26513 LDKCResult_QueryShortChannelIdsDecodeErrorZ* o_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(o);
26514 jboolean ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(o_conv);
26518 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26519 if (!ptr_is_owned(_res)) return;
26520 void* _res_ptr = untag_ptr(_res);
26521 CHECK_ACCESS(_res_ptr);
26522 LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(_res_ptr);
26523 FREE(untag_ptr(_res));
26524 CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv);
26527 static inline uint64_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg) {
26528 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
26529 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(arg);
26530 return tag_ptr(ret_conv, true);
26532 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26533 LDKCResult_QueryShortChannelIdsDecodeErrorZ* arg_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(arg);
26534 int64_t ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg_conv);
26538 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26539 LDKCResult_QueryShortChannelIdsDecodeErrorZ* orig_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(orig);
26540 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
26541 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(orig_conv);
26542 return tag_ptr(ret_conv, true);
26545 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
26546 LDKReplyShortChannelIdsEnd o_conv;
26547 o_conv.inner = untag_ptr(o);
26548 o_conv.is_owned = ptr_is_owned(o);
26549 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
26550 o_conv = ReplyShortChannelIdsEnd_clone(&o_conv);
26551 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
26552 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o_conv);
26553 return tag_ptr(ret_conv, true);
26556 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
26557 void* e_ptr = untag_ptr(e);
26558 CHECK_ACCESS(e_ptr);
26559 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
26560 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
26561 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
26562 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv);
26563 return tag_ptr(ret_conv, true);
26566 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
26567 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* o_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(o);
26568 jboolean ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(o_conv);
26572 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26573 if (!ptr_is_owned(_res)) return;
26574 void* _res_ptr = untag_ptr(_res);
26575 CHECK_ACCESS(_res_ptr);
26576 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(_res_ptr);
26577 FREE(untag_ptr(_res));
26578 CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv);
26581 static inline uint64_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg) {
26582 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
26583 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(arg);
26584 return tag_ptr(ret_conv, true);
26586 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26587 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* arg_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(arg);
26588 int64_t ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg_conv);
26592 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26593 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* orig_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(orig);
26594 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
26595 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(orig_conv);
26596 return tag_ptr(ret_conv, true);
26599 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
26600 LDKQueryChannelRange o_conv;
26601 o_conv.inner = untag_ptr(o);
26602 o_conv.is_owned = ptr_is_owned(o);
26603 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
26604 o_conv = QueryChannelRange_clone(&o_conv);
26605 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
26606 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_ok(o_conv);
26607 return tag_ptr(ret_conv, true);
26610 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
26611 void* e_ptr = untag_ptr(e);
26612 CHECK_ACCESS(e_ptr);
26613 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
26614 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
26615 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
26616 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv);
26617 return tag_ptr(ret_conv, true);
26620 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
26621 LDKCResult_QueryChannelRangeDecodeErrorZ* o_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(o);
26622 jboolean ret_conv = CResult_QueryChannelRangeDecodeErrorZ_is_ok(o_conv);
26626 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26627 if (!ptr_is_owned(_res)) return;
26628 void* _res_ptr = untag_ptr(_res);
26629 CHECK_ACCESS(_res_ptr);
26630 LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)(_res_ptr);
26631 FREE(untag_ptr(_res));
26632 CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv);
26635 static inline uint64_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
26636 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
26637 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(arg);
26638 return tag_ptr(ret_conv, true);
26640 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26641 LDKCResult_QueryChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(arg);
26642 int64_t ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
26646 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26647 LDKCResult_QueryChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(orig);
26648 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
26649 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(orig_conv);
26650 return tag_ptr(ret_conv, true);
26653 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
26654 LDKReplyChannelRange o_conv;
26655 o_conv.inner = untag_ptr(o);
26656 o_conv.is_owned = ptr_is_owned(o);
26657 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
26658 o_conv = ReplyChannelRange_clone(&o_conv);
26659 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
26660 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_ok(o_conv);
26661 return tag_ptr(ret_conv, true);
26664 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
26665 void* e_ptr = untag_ptr(e);
26666 CHECK_ACCESS(e_ptr);
26667 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
26668 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
26669 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
26670 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv);
26671 return tag_ptr(ret_conv, true);
26674 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
26675 LDKCResult_ReplyChannelRangeDecodeErrorZ* o_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(o);
26676 jboolean ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_is_ok(o_conv);
26680 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26681 if (!ptr_is_owned(_res)) return;
26682 void* _res_ptr = untag_ptr(_res);
26683 CHECK_ACCESS(_res_ptr);
26684 LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)(_res_ptr);
26685 FREE(untag_ptr(_res));
26686 CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv);
26689 static inline uint64_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
26690 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
26691 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(arg);
26692 return tag_ptr(ret_conv, true);
26694 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26695 LDKCResult_ReplyChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(arg);
26696 int64_t ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
26700 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26701 LDKCResult_ReplyChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(orig);
26702 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
26703 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(orig_conv);
26704 return tag_ptr(ret_conv, true);
26707 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
26708 LDKGossipTimestampFilter o_conv;
26709 o_conv.inner = untag_ptr(o);
26710 o_conv.is_owned = ptr_is_owned(o);
26711 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
26712 o_conv = GossipTimestampFilter_clone(&o_conv);
26713 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
26714 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_ok(o_conv);
26715 return tag_ptr(ret_conv, true);
26718 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
26719 void* e_ptr = untag_ptr(e);
26720 CHECK_ACCESS(e_ptr);
26721 LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
26722 e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
26723 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
26724 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv);
26725 return tag_ptr(ret_conv, true);
26728 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
26729 LDKCResult_GossipTimestampFilterDecodeErrorZ* o_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(o);
26730 jboolean ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_is_ok(o_conv);
26734 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26735 if (!ptr_is_owned(_res)) return;
26736 void* _res_ptr = untag_ptr(_res);
26737 CHECK_ACCESS(_res_ptr);
26738 LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)(_res_ptr);
26739 FREE(untag_ptr(_res));
26740 CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv);
26743 static inline uint64_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg) {
26744 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
26745 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(arg);
26746 return tag_ptr(ret_conv, true);
26748 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26749 LDKCResult_GossipTimestampFilterDecodeErrorZ* arg_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(arg);
26750 int64_t ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg_conv);
26754 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26755 LDKCResult_GossipTimestampFilterDecodeErrorZ* orig_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(orig);
26756 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
26757 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(orig_conv);
26758 return tag_ptr(ret_conv, true);
26761 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PhantomRouteHintsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
26762 LDKCVec_PhantomRouteHintsZ _res_constr;
26763 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
26764 if (_res_constr.datalen > 0)
26765 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements");
26767 _res_constr.data = NULL;
26768 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
26769 for (size_t t = 0; t < _res_constr.datalen; t++) {
26770 int64_t _res_conv_19 = _res_vals[t];
26771 LDKPhantomRouteHints _res_conv_19_conv;
26772 _res_conv_19_conv.inner = untag_ptr(_res_conv_19);
26773 _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19);
26774 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv);
26775 _res_constr.data[t] = _res_conv_19_conv;
26777 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
26778 CVec_PhantomRouteHintsZ_free(_res_constr);
26781 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
26783 o_conv.inner = untag_ptr(o);
26784 o_conv.is_owned = ptr_is_owned(o);
26785 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
26786 o_conv = Invoice_clone(&o_conv);
26787 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
26788 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_ok(o_conv);
26789 return tag_ptr(ret_conv, true);
26792 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
26793 void* e_ptr = untag_ptr(e);
26794 CHECK_ACCESS(e_ptr);
26795 LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr);
26796 e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)untag_ptr(e));
26797 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
26798 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_err(e_conv);
26799 return tag_ptr(ret_conv, true);
26802 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
26803 LDKCResult_InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(o);
26804 jboolean ret_conv = CResult_InvoiceSignOrCreationErrorZ_is_ok(o_conv);
26808 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26809 if (!ptr_is_owned(_res)) return;
26810 void* _res_ptr = untag_ptr(_res);
26811 CHECK_ACCESS(_res_ptr);
26812 LDKCResult_InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_InvoiceSignOrCreationErrorZ*)(_res_ptr);
26813 FREE(untag_ptr(_res));
26814 CResult_InvoiceSignOrCreationErrorZ_free(_res_conv);
26817 static inline uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) {
26818 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
26819 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(arg);
26820 return tag_ptr(ret_conv, true);
26822 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26823 LDKCResult_InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(arg);
26824 int64_t ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv);
26828 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26829 LDKCResult_InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(orig);
26830 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
26831 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(orig_conv);
26832 return tag_ptr(ret_conv, true);
26835 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1FutureZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
26836 LDKCVec_FutureZ _res_constr;
26837 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
26838 if (_res_constr.datalen > 0)
26839 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKFuture), "LDKCVec_FutureZ Elements");
26841 _res_constr.data = NULL;
26842 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
26843 for (size_t i = 0; i < _res_constr.datalen; i++) {
26844 int64_t _res_conv_8 = _res_vals[i];
26845 LDKFuture _res_conv_8_conv;
26846 _res_conv_8_conv.inner = untag_ptr(_res_conv_8);
26847 _res_conv_8_conv.is_owned = ptr_is_owned(_res_conv_8);
26848 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_8_conv);
26849 _res_constr.data[i] = _res_conv_8_conv;
26851 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
26852 CVec_FutureZ_free(_res_constr);
26855 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1FilterZ_1some(JNIEnv *env, jclass clz, int64_t o) {
26856 void* o_ptr = untag_ptr(o);
26857 CHECK_ACCESS(o_ptr);
26858 LDKFilter o_conv = *(LDKFilter*)(o_ptr);
26859 if (o_conv.free == LDKFilter_JCalls_free) {
26860 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26861 LDKFilter_JCalls_cloned(&o_conv);
26863 LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
26864 *ret_copy = COption_FilterZ_some(o_conv);
26865 int64_t ret_ref = tag_ptr(ret_copy, true);
26869 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1FilterZ_1none(JNIEnv *env, jclass clz) {
26870 LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
26871 *ret_copy = COption_FilterZ_none();
26872 int64_t ret_ref = tag_ptr(ret_copy, true);
26876 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1FilterZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26877 if (!ptr_is_owned(_res)) return;
26878 void* _res_ptr = untag_ptr(_res);
26879 CHECK_ACCESS(_res_ptr);
26880 LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr);
26881 FREE(untag_ptr(_res));
26882 COption_FilterZ_free(_res_conv);
26885 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
26886 LDKLockedChannelMonitor o_conv;
26887 o_conv.inner = untag_ptr(o);
26888 o_conv.is_owned = ptr_is_owned(o);
26889 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
26890 // WARNING: we need a move here but no clone is available for LDKLockedChannelMonitor
26892 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
26893 *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv);
26894 return tag_ptr(ret_conv, true);
26897 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1err(JNIEnv *env, jclass clz) {
26898 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
26899 *ret_conv = CResult_LockedChannelMonitorNoneZ_err();
26900 return tag_ptr(ret_conv, true);
26903 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
26904 LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(o);
26905 jboolean ret_conv = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv);
26909 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
26910 if (!ptr_is_owned(_res)) return;
26911 void* _res_ptr = untag_ptr(_res);
26912 CHECK_ACCESS(_res_ptr);
26913 LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr);
26914 FREE(untag_ptr(_res));
26915 CResult_LockedChannelMonitorNoneZ_free(_res_conv);
26918 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1OutPointZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
26919 LDKCVec_OutPointZ _res_constr;
26920 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
26921 if (_res_constr.datalen > 0)
26922 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKOutPoint), "LDKCVec_OutPointZ Elements");
26924 _res_constr.data = NULL;
26925 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
26926 for (size_t k = 0; k < _res_constr.datalen; k++) {
26927 int64_t _res_conv_10 = _res_vals[k];
26928 LDKOutPoint _res_conv_10_conv;
26929 _res_conv_10_conv.inner = untag_ptr(_res_conv_10);
26930 _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10);
26931 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
26932 _res_constr.data[k] = _res_conv_10_conv;
26934 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
26935 CVec_OutPointZ_free(_res_constr);
26938 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorUpdateIdZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
26939 LDKCVec_MonitorUpdateIdZ _res_constr;
26940 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
26941 if (_res_constr.datalen > 0)
26942 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements");
26944 _res_constr.data = NULL;
26945 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
26946 for (size_t r = 0; r < _res_constr.datalen; r++) {
26947 int64_t _res_conv_17 = _res_vals[r];
26948 LDKMonitorUpdateId _res_conv_17_conv;
26949 _res_conv_17_conv.inner = untag_ptr(_res_conv_17);
26950 _res_conv_17_conv.is_owned = ptr_is_owned(_res_conv_17);
26951 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_17_conv);
26952 _res_constr.data[r] = _res_conv_17_conv;
26954 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
26955 CVec_MonitorUpdateIdZ_free(_res_constr);
26958 static inline uint64_t C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR arg) {
26959 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ");
26960 *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(arg);
26961 return tag_ptr(ret_conv, true);
26963 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
26964 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* arg_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(arg);
26965 int64_t ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(arg_conv);
26969 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
26970 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* orig_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(orig);
26971 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ");
26972 *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(orig_conv);
26973 return tag_ptr(ret_conv, true);
26976 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_tArray b) {
26977 LDKOutPoint a_conv;
26978 a_conv.inner = untag_ptr(a);
26979 a_conv.is_owned = ptr_is_owned(a);
26980 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
26981 a_conv = OutPoint_clone(&a_conv);
26982 LDKCVec_MonitorUpdateIdZ b_constr;
26983 b_constr.datalen = (*env)->GetArrayLength(env, b);
26984 if (b_constr.datalen > 0)
26985 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements");
26987 b_constr.data = NULL;
26988 int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL);
26989 for (size_t r = 0; r < b_constr.datalen; r++) {
26990 int64_t b_conv_17 = b_vals[r];
26991 LDKMonitorUpdateId b_conv_17_conv;
26992 b_conv_17_conv.inner = untag_ptr(b_conv_17);
26993 b_conv_17_conv.is_owned = ptr_is_owned(b_conv_17);
26994 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv_17_conv);
26995 b_conv_17_conv = MonitorUpdateId_clone(&b_conv_17_conv);
26996 b_constr.data[r] = b_conv_17_conv;
26998 (*env)->ReleaseLongArrayElements(env, b, b_vals, 0);
26999 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ");
27000 *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a_conv, b_constr);
27001 return tag_ptr(ret_conv, true);
27004 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
27005 if (!ptr_is_owned(_res)) return;
27006 void* _res_ptr = untag_ptr(_res);
27007 CHECK_ACCESS(_res_ptr);
27008 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_ptr);
27009 FREE(untag_ptr(_res));
27010 C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(_res_conv);
27013 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OutPointCVec_1MonitorUpdateIdZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
27014 LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res_constr;
27015 _res_constr.datalen = (*env)->GetArrayLength(env, _res);
27016 if (_res_constr.datalen > 0)
27017 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ Elements");
27019 _res_constr.data = NULL;
27020 int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL);
27021 for (size_t p = 0; p < _res_constr.datalen; p++) {
27022 int64_t _res_conv_41 = _res_vals[p];
27023 void* _res_conv_41_ptr = untag_ptr(_res_conv_41);
27024 CHECK_ACCESS(_res_conv_41_ptr);
27025 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv_41_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_conv_41_ptr);
27026 FREE(untag_ptr(_res_conv_41));
27027 _res_constr.data[p] = _res_conv_41_conv;
27029 (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0);
27030 CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(_res_constr);
27033 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1ok(JNIEnv *env, jclass clz, int32_t o) {
27034 LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
27035 *ret_conv = CResult_u32GraphSyncErrorZ_ok(o);
27036 return tag_ptr(ret_conv, true);
27039 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
27040 void* e_ptr = untag_ptr(e);
27041 CHECK_ACCESS(e_ptr);
27042 LDKGraphSyncError e_conv = *(LDKGraphSyncError*)(e_ptr);
27043 e_conv = GraphSyncError_clone((LDKGraphSyncError*)untag_ptr(e));
27044 LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
27045 *ret_conv = CResult_u32GraphSyncErrorZ_err(e_conv);
27046 return tag_ptr(ret_conv, true);
27049 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
27050 LDKCResult_u32GraphSyncErrorZ* o_conv = (LDKCResult_u32GraphSyncErrorZ*)untag_ptr(o);
27051 jboolean ret_conv = CResult_u32GraphSyncErrorZ_is_ok(o_conv);
27055 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
27056 if (!ptr_is_owned(_res)) return;
27057 void* _res_ptr = untag_ptr(_res);
27058 CHECK_ACCESS(_res_ptr);
27059 LDKCResult_u32GraphSyncErrorZ _res_conv = *(LDKCResult_u32GraphSyncErrorZ*)(_res_ptr);
27060 FREE(untag_ptr(_res));
27061 CResult_u32GraphSyncErrorZ_free(_res_conv);
27064 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27065 if (!ptr_is_owned(this_ptr)) return;
27066 void* this_ptr_ptr = untag_ptr(this_ptr);
27067 CHECK_ACCESS(this_ptr_ptr);
27068 LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr);
27069 FREE(untag_ptr(this_ptr));
27070 APIError_free(this_ptr_conv);
27073 static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) {
27074 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
27075 *ret_copy = APIError_clone(arg);
27076 int64_t ret_ref = tag_ptr(ret_copy, true);
27079 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27080 LDKAPIError* arg_conv = (LDKAPIError*)untag_ptr(arg);
27081 int64_t ret_conv = APIError_clone_ptr(arg_conv);
27085 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27086 LDKAPIError* orig_conv = (LDKAPIError*)untag_ptr(orig);
27087 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
27088 *ret_copy = APIError_clone(orig_conv);
27089 int64_t ret_ref = tag_ptr(ret_copy, true);
27093 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1apimisuse_1error(JNIEnv *env, jclass clz, jstring err) {
27094 LDKStr err_conv = java_to_owned_str(env, err);
27095 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
27096 *ret_copy = APIError_apimisuse_error(err_conv);
27097 int64_t ret_ref = tag_ptr(ret_copy, true);
27101 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1fee_1rate_1too_1high(JNIEnv *env, jclass clz, jstring err, int32_t feerate) {
27102 LDKStr err_conv = java_to_owned_str(env, err);
27103 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
27104 *ret_copy = APIError_fee_rate_too_high(err_conv, feerate);
27105 int64_t ret_ref = tag_ptr(ret_copy, true);
27109 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1invalid_1route(JNIEnv *env, jclass clz, jstring err) {
27110 LDKStr err_conv = java_to_owned_str(env, err);
27111 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
27112 *ret_copy = APIError_invalid_route(err_conv);
27113 int64_t ret_ref = tag_ptr(ret_copy, true);
27117 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1channel_1unavailable(JNIEnv *env, jclass clz, jstring err) {
27118 LDKStr err_conv = java_to_owned_str(env, err);
27119 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
27120 *ret_copy = APIError_channel_unavailable(err_conv);
27121 int64_t ret_ref = tag_ptr(ret_copy, true);
27125 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1monitor_1update_1in_1progress(JNIEnv *env, jclass clz) {
27126 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
27127 *ret_copy = APIError_monitor_update_in_progress();
27128 int64_t ret_ref = tag_ptr(ret_copy, true);
27132 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1incompatible_1shutdown_1script(JNIEnv *env, jclass clz, int64_t script) {
27133 LDKShutdownScript script_conv;
27134 script_conv.inner = untag_ptr(script);
27135 script_conv.is_owned = ptr_is_owned(script);
27136 CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv);
27137 script_conv = ShutdownScript_clone(&script_conv);
27138 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
27139 *ret_copy = APIError_incompatible_shutdown_script(script_conv);
27140 int64_t ret_ref = tag_ptr(ret_copy, true);
27144 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_APIError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
27145 LDKAPIError* a_conv = (LDKAPIError*)untag_ptr(a);
27146 LDKAPIError* b_conv = (LDKAPIError*)untag_ptr(b);
27147 jboolean ret_conv = APIError_eq(a_conv, b_conv);
27151 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_APIError_1write(JNIEnv *env, jclass clz, int64_t obj) {
27152 LDKAPIError* obj_conv = (LDKAPIError*)untag_ptr(obj);
27153 LDKCVec_u8Z ret_var = APIError_write(obj_conv);
27154 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
27155 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
27156 CVec_u8Z_free(ret_var);
27160 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
27161 LDKu8slice ser_ref;
27162 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
27163 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
27164 LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ");
27165 *ret_conv = APIError_read(ser_ref);
27166 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
27167 return tag_ptr(ret_conv, true);
27170 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BigSize_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27171 LDKBigSize this_obj_conv;
27172 this_obj_conv.inner = untag_ptr(this_obj);
27173 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27174 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27175 BigSize_free(this_obj_conv);
27178 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BigSize_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
27179 LDKBigSize this_ptr_conv;
27180 this_ptr_conv.inner = untag_ptr(this_ptr);
27181 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27182 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27183 this_ptr_conv.is_owned = false;
27184 int64_t ret_conv = BigSize_get_a(&this_ptr_conv);
27188 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BigSize_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
27189 LDKBigSize this_ptr_conv;
27190 this_ptr_conv.inner = untag_ptr(this_ptr);
27191 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27192 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27193 this_ptr_conv.is_owned = false;
27194 BigSize_set_a(&this_ptr_conv, val);
27197 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BigSize_1new(JNIEnv *env, jclass clz, int64_t a_arg) {
27198 LDKBigSize ret_var = BigSize_new(a_arg);
27199 int64_t ret_ref = 0;
27200 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27201 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27205 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Hostname_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27206 LDKHostname this_obj_conv;
27207 this_obj_conv.inner = untag_ptr(this_obj);
27208 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27209 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27210 Hostname_free(this_obj_conv);
27213 static inline uint64_t Hostname_clone_ptr(LDKHostname *NONNULL_PTR arg) {
27214 LDKHostname ret_var = Hostname_clone(arg);
27215 int64_t ret_ref = 0;
27216 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27217 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27220 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Hostname_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27221 LDKHostname arg_conv;
27222 arg_conv.inner = untag_ptr(arg);
27223 arg_conv.is_owned = ptr_is_owned(arg);
27224 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27225 arg_conv.is_owned = false;
27226 int64_t ret_conv = Hostname_clone_ptr(&arg_conv);
27230 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Hostname_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27231 LDKHostname orig_conv;
27232 orig_conv.inner = untag_ptr(orig);
27233 orig_conv.is_owned = ptr_is_owned(orig);
27234 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27235 orig_conv.is_owned = false;
27236 LDKHostname ret_var = Hostname_clone(&orig_conv);
27237 int64_t ret_ref = 0;
27238 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27239 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27243 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Hostname_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
27244 LDKHostname a_conv;
27245 a_conv.inner = untag_ptr(a);
27246 a_conv.is_owned = ptr_is_owned(a);
27247 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
27248 a_conv.is_owned = false;
27249 LDKHostname b_conv;
27250 b_conv.inner = untag_ptr(b);
27251 b_conv.is_owned = ptr_is_owned(b);
27252 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
27253 b_conv.is_owned = false;
27254 jboolean ret_conv = Hostname_eq(&a_conv, &b_conv);
27258 JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_Hostname_1len(JNIEnv *env, jclass clz, int64_t this_arg) {
27259 LDKHostname this_arg_conv;
27260 this_arg_conv.inner = untag_ptr(this_arg);
27261 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27262 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27263 this_arg_conv.is_owned = false;
27264 int8_t ret_conv = Hostname_len(&this_arg_conv);
27268 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_sign(JNIEnv *env, jclass clz, int8_tArray msg, int8_tArray sk) {
27269 LDKu8slice msg_ref;
27270 msg_ref.datalen = (*env)->GetArrayLength(env, msg);
27271 msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL);
27272 uint8_t sk_arr[32];
27273 CHECK((*env)->GetArrayLength(env, sk) == 32);
27274 (*env)->GetByteArrayRegion(env, sk, 0, 32, sk_arr);
27275 uint8_t (*sk_ref)[32] = &sk_arr;
27276 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
27277 *ret_conv = sign(msg_ref, sk_ref);
27278 (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0);
27279 return tag_ptr(ret_conv, true);
27282 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_recover_1pk(JNIEnv *env, jclass clz, int8_tArray msg, jstring sig) {
27283 LDKu8slice msg_ref;
27284 msg_ref.datalen = (*env)->GetArrayLength(env, msg);
27285 msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL);
27286 LDKStr sig_conv = java_to_owned_str(env, sig);
27287 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
27288 *ret_conv = recover_pk(msg_ref, sig_conv);
27289 (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0);
27290 return tag_ptr(ret_conv, true);
27293 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_verify(JNIEnv *env, jclass clz, int8_tArray msg, jstring sig, int8_tArray pk) {
27294 LDKu8slice msg_ref;
27295 msg_ref.datalen = (*env)->GetArrayLength(env, msg);
27296 msg_ref.data = (*env)->GetByteArrayElements (env, msg, NULL);
27297 LDKStr sig_conv = java_to_owned_str(env, sig);
27298 LDKPublicKey pk_ref;
27299 CHECK((*env)->GetArrayLength(env, pk) == 33);
27300 (*env)->GetByteArrayRegion(env, pk, 0, 33, pk_ref.compressed_form);
27301 jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref);
27302 (*env)->ReleaseByteArrayElements(env, msg, (int8_t*)msg_ref.data, 0);
27306 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_construct_1invoice_1preimage(JNIEnv *env, jclass clz, int8_tArray hrp_bytes, jobjectArray data_without_signature) {
27307 LDKu8slice hrp_bytes_ref;
27308 hrp_bytes_ref.datalen = (*env)->GetArrayLength(env, hrp_bytes);
27309 hrp_bytes_ref.data = (*env)->GetByteArrayElements (env, hrp_bytes, NULL);
27310 LDKCVec_U5Z data_without_signature_constr;
27311 data_without_signature_constr.datalen = (*env)->GetArrayLength(env, data_without_signature);
27312 if (data_without_signature_constr.datalen > 0)
27313 data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements");
27315 data_without_signature_constr.data = NULL;
27316 int8_t* data_without_signature_vals = (*env)->GetByteArrayElements (env, data_without_signature, NULL);
27317 for (size_t h = 0; h < data_without_signature_constr.datalen; h++) {
27318 int8_t data_without_signature_conv_7 = data_without_signature_vals[h];
27320 data_without_signature_constr.data[h] = (LDKU5){ ._0 = data_without_signature_conv_7 };
27322 (*env)->ReleaseByteArrayElements(env, data_without_signature, data_without_signature_vals, 0);
27323 LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr);
27324 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
27325 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
27326 CVec_u8Z_free(ret_var);
27327 (*env)->ReleaseByteArrayElements(env, hrp_bytes, (int8_t*)hrp_bytes_ref.data, 0);
27331 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persister_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27332 if (!ptr_is_owned(this_ptr)) return;
27333 void* this_ptr_ptr = untag_ptr(this_ptr);
27334 CHECK_ACCESS(this_ptr_ptr);
27335 LDKPersister this_ptr_conv = *(LDKPersister*)(this_ptr_ptr);
27336 FREE(untag_ptr(this_ptr));
27337 Persister_free(this_ptr_conv);
27340 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UntrustedString_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27341 LDKUntrustedString this_obj_conv;
27342 this_obj_conv.inner = untag_ptr(this_obj);
27343 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27344 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27345 UntrustedString_free(this_obj_conv);
27348 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_UntrustedString_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
27349 LDKUntrustedString this_ptr_conv;
27350 this_ptr_conv.inner = untag_ptr(this_ptr);
27351 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27352 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27353 this_ptr_conv.is_owned = false;
27354 LDKStr ret_str = UntrustedString_get_a(&this_ptr_conv);
27355 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
27360 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UntrustedString_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
27361 LDKUntrustedString this_ptr_conv;
27362 this_ptr_conv.inner = untag_ptr(this_ptr);
27363 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27364 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27365 this_ptr_conv.is_owned = false;
27366 LDKStr val_conv = java_to_owned_str(env, val);
27367 UntrustedString_set_a(&this_ptr_conv, val_conv);
27370 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1new(JNIEnv *env, jclass clz, jstring a_arg) {
27371 LDKStr a_arg_conv = java_to_owned_str(env, a_arg);
27372 LDKUntrustedString ret_var = UntrustedString_new(a_arg_conv);
27373 int64_t ret_ref = 0;
27374 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27375 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27379 static inline uint64_t UntrustedString_clone_ptr(LDKUntrustedString *NONNULL_PTR arg) {
27380 LDKUntrustedString ret_var = UntrustedString_clone(arg);
27381 int64_t ret_ref = 0;
27382 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27383 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27386 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27387 LDKUntrustedString arg_conv;
27388 arg_conv.inner = untag_ptr(arg);
27389 arg_conv.is_owned = ptr_is_owned(arg);
27390 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27391 arg_conv.is_owned = false;
27392 int64_t ret_conv = UntrustedString_clone_ptr(&arg_conv);
27396 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27397 LDKUntrustedString orig_conv;
27398 orig_conv.inner = untag_ptr(orig);
27399 orig_conv.is_owned = ptr_is_owned(orig);
27400 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27401 orig_conv.is_owned = false;
27402 LDKUntrustedString ret_var = UntrustedString_clone(&orig_conv);
27403 int64_t ret_ref = 0;
27404 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27405 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27409 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UntrustedString_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
27410 LDKUntrustedString a_conv;
27411 a_conv.inner = untag_ptr(a);
27412 a_conv.is_owned = ptr_is_owned(a);
27413 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
27414 a_conv.is_owned = false;
27415 LDKUntrustedString b_conv;
27416 b_conv.inner = untag_ptr(b);
27417 b_conv.is_owned = ptr_is_owned(b);
27418 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
27419 b_conv.is_owned = false;
27420 jboolean ret_conv = UntrustedString_eq(&a_conv, &b_conv);
27424 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UntrustedString_1write(JNIEnv *env, jclass clz, int64_t obj) {
27425 LDKUntrustedString obj_conv;
27426 obj_conv.inner = untag_ptr(obj);
27427 obj_conv.is_owned = ptr_is_owned(obj);
27428 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
27429 obj_conv.is_owned = false;
27430 LDKCVec_u8Z ret_var = UntrustedString_write(&obj_conv);
27431 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
27432 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
27433 CVec_u8Z_free(ret_var);
27437 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UntrustedString_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
27438 LDKu8slice ser_ref;
27439 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
27440 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
27441 LDKCResult_UntrustedStringDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UntrustedStringDecodeErrorZ), "LDKCResult_UntrustedStringDecodeErrorZ");
27442 *ret_conv = UntrustedString_read(ser_ref);
27443 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
27444 return tag_ptr(ret_conv, true);
27447 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27448 LDKPrintableString this_obj_conv;
27449 this_obj_conv.inner = untag_ptr(this_obj);
27450 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27451 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27452 PrintableString_free(this_obj_conv);
27455 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_PrintableString_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
27456 LDKPrintableString this_ptr_conv;
27457 this_ptr_conv.inner = untag_ptr(this_ptr);
27458 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27459 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27460 this_ptr_conv.is_owned = false;
27461 LDKStr ret_str = PrintableString_get_a(&this_ptr_conv);
27462 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
27467 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
27468 LDKPrintableString this_ptr_conv;
27469 this_ptr_conv.inner = untag_ptr(this_ptr);
27470 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27471 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27472 this_ptr_conv.is_owned = false;
27473 LDKStr val_conv = java_to_owned_str(env, val);
27474 PrintableString_set_a(&this_ptr_conv, val_conv);
27477 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrintableString_1new(JNIEnv *env, jclass clz, jstring a_arg) {
27478 LDKStr a_arg_conv = java_to_owned_str(env, a_arg);
27479 LDKPrintableString ret_var = PrintableString_new(a_arg_conv);
27480 int64_t ret_ref = 0;
27481 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27482 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27486 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FutureCallback_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27487 if (!ptr_is_owned(this_ptr)) return;
27488 void* this_ptr_ptr = untag_ptr(this_ptr);
27489 CHECK_ACCESS(this_ptr_ptr);
27490 LDKFutureCallback this_ptr_conv = *(LDKFutureCallback*)(this_ptr_ptr);
27491 FREE(untag_ptr(this_ptr));
27492 FutureCallback_free(this_ptr_conv);
27495 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Future_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27496 LDKFuture this_obj_conv;
27497 this_obj_conv.inner = untag_ptr(this_obj);
27498 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27499 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27500 Future_free(this_obj_conv);
27503 static inline uint64_t Future_clone_ptr(LDKFuture *NONNULL_PTR arg) {
27504 LDKFuture ret_var = Future_clone(arg);
27505 int64_t ret_ref = 0;
27506 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27507 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27510 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Future_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27511 LDKFuture arg_conv;
27512 arg_conv.inner = untag_ptr(arg);
27513 arg_conv.is_owned = ptr_is_owned(arg);
27514 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27515 arg_conv.is_owned = false;
27516 int64_t ret_conv = Future_clone_ptr(&arg_conv);
27520 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Future_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27521 LDKFuture orig_conv;
27522 orig_conv.inner = untag_ptr(orig);
27523 orig_conv.is_owned = ptr_is_owned(orig);
27524 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27525 orig_conv.is_owned = false;
27526 LDKFuture ret_var = Future_clone(&orig_conv);
27527 int64_t ret_ref = 0;
27528 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27529 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27533 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Future_1register_1callback_1fn(JNIEnv *env, jclass clz, int64_t this_arg, int64_t callback) {
27534 LDKFuture this_arg_conv;
27535 this_arg_conv.inner = untag_ptr(this_arg);
27536 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27537 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27538 this_arg_conv.is_owned = false;
27539 void* callback_ptr = untag_ptr(callback);
27540 CHECK_ACCESS(callback_ptr);
27541 LDKFutureCallback callback_conv = *(LDKFutureCallback*)(callback_ptr);
27542 if (callback_conv.free == LDKFutureCallback_JCalls_free) {
27543 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
27544 LDKFutureCallback_JCalls_cloned(&callback_conv);
27546 Future_register_callback_fn(&this_arg_conv, callback_conv);
27549 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Future_1wait(JNIEnv *env, jclass clz, int64_t this_arg) {
27550 LDKFuture this_arg_conv;
27551 this_arg_conv.inner = untag_ptr(this_arg);
27552 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27553 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27554 this_arg_conv = Future_clone(&this_arg_conv);
27555 Future_wait(this_arg_conv);
27558 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Future_1wait_1timeout(JNIEnv *env, jclass clz, int64_t this_arg, int64_t max_wait) {
27559 LDKFuture this_arg_conv;
27560 this_arg_conv.inner = untag_ptr(this_arg);
27561 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27562 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27563 this_arg_conv = Future_clone(&this_arg_conv);
27564 jboolean ret_conv = Future_wait_timeout(this_arg_conv, max_wait);
27568 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sleeper_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27569 LDKSleeper this_obj_conv;
27570 this_obj_conv.inner = untag_ptr(this_obj);
27571 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27572 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27573 Sleeper_free(this_obj_conv);
27576 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sleeper_1from_1single_1future(JNIEnv *env, jclass clz, int64_t future) {
27577 LDKFuture future_conv;
27578 future_conv.inner = untag_ptr(future);
27579 future_conv.is_owned = ptr_is_owned(future);
27580 CHECK_INNER_FIELD_ACCESS_OR_NULL(future_conv);
27581 future_conv = Future_clone(&future_conv);
27582 LDKSleeper ret_var = Sleeper_from_single_future(future_conv);
27583 int64_t ret_ref = 0;
27584 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27585 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27589 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sleeper_1from_1two_1futures(JNIEnv *env, jclass clz, int64_t fut_a, int64_t fut_b) {
27590 LDKFuture fut_a_conv;
27591 fut_a_conv.inner = untag_ptr(fut_a);
27592 fut_a_conv.is_owned = ptr_is_owned(fut_a);
27593 CHECK_INNER_FIELD_ACCESS_OR_NULL(fut_a_conv);
27594 fut_a_conv = Future_clone(&fut_a_conv);
27595 LDKFuture fut_b_conv;
27596 fut_b_conv.inner = untag_ptr(fut_b);
27597 fut_b_conv.is_owned = ptr_is_owned(fut_b);
27598 CHECK_INNER_FIELD_ACCESS_OR_NULL(fut_b_conv);
27599 fut_b_conv = Future_clone(&fut_b_conv);
27600 LDKSleeper ret_var = Sleeper_from_two_futures(fut_a_conv, fut_b_conv);
27601 int64_t ret_ref = 0;
27602 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27603 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27607 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sleeper_1new(JNIEnv *env, jclass clz, int64_tArray futures) {
27608 LDKCVec_FutureZ futures_constr;
27609 futures_constr.datalen = (*env)->GetArrayLength(env, futures);
27610 if (futures_constr.datalen > 0)
27611 futures_constr.data = MALLOC(futures_constr.datalen * sizeof(LDKFuture), "LDKCVec_FutureZ Elements");
27613 futures_constr.data = NULL;
27614 int64_t* futures_vals = (*env)->GetLongArrayElements (env, futures, NULL);
27615 for (size_t i = 0; i < futures_constr.datalen; i++) {
27616 int64_t futures_conv_8 = futures_vals[i];
27617 LDKFuture futures_conv_8_conv;
27618 futures_conv_8_conv.inner = untag_ptr(futures_conv_8);
27619 futures_conv_8_conv.is_owned = ptr_is_owned(futures_conv_8);
27620 CHECK_INNER_FIELD_ACCESS_OR_NULL(futures_conv_8_conv);
27621 futures_conv_8_conv = Future_clone(&futures_conv_8_conv);
27622 futures_constr.data[i] = futures_conv_8_conv;
27624 (*env)->ReleaseLongArrayElements(env, futures, futures_vals, 0);
27625 LDKSleeper ret_var = Sleeper_new(futures_constr);
27626 int64_t ret_ref = 0;
27627 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27628 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27632 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sleeper_1wait(JNIEnv *env, jclass clz, int64_t this_arg) {
27633 LDKSleeper this_arg_conv;
27634 this_arg_conv.inner = untag_ptr(this_arg);
27635 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27636 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27637 this_arg_conv.is_owned = false;
27638 Sleeper_wait(&this_arg_conv);
27641 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Sleeper_1wait_1timeout(JNIEnv *env, jclass clz, int64_t this_arg, int64_t max_wait) {
27642 LDKSleeper this_arg_conv;
27643 this_arg_conv.inner = untag_ptr(this_arg);
27644 this_arg_conv.is_owned = ptr_is_owned(this_arg);
27645 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
27646 this_arg_conv.is_owned = false;
27647 jboolean ret_conv = Sleeper_wait_timeout(&this_arg_conv, max_wait);
27651 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27652 LDKLevel* orig_conv = (LDKLevel*)untag_ptr(orig);
27653 jclass ret_conv = LDKLevel_to_java(env, Level_clone(orig_conv));
27657 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1gossip(JNIEnv *env, jclass clz) {
27658 jclass ret_conv = LDKLevel_to_java(env, Level_gossip());
27662 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1trace(JNIEnv *env, jclass clz) {
27663 jclass ret_conv = LDKLevel_to_java(env, Level_trace());
27667 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1debug(JNIEnv *env, jclass clz) {
27668 jclass ret_conv = LDKLevel_to_java(env, Level_debug());
27672 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1info(JNIEnv *env, jclass clz) {
27673 jclass ret_conv = LDKLevel_to_java(env, Level_info());
27677 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1warn(JNIEnv *env, jclass clz) {
27678 jclass ret_conv = LDKLevel_to_java(env, Level_warn());
27682 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1error(JNIEnv *env, jclass clz) {
27683 jclass ret_conv = LDKLevel_to_java(env, Level_error());
27687 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Level_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
27688 LDKLevel* a_conv = (LDKLevel*)untag_ptr(a);
27689 LDKLevel* b_conv = (LDKLevel*)untag_ptr(b);
27690 jboolean ret_conv = Level_eq(a_conv, b_conv);
27694 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Level_1hash(JNIEnv *env, jclass clz, int64_t o) {
27695 LDKLevel* o_conv = (LDKLevel*)untag_ptr(o);
27696 int64_t ret_conv = Level_hash(o_conv);
27700 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv *env, jclass clz) {
27701 jclass ret_conv = LDKLevel_to_java(env, Level_max());
27705 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27706 LDKRecord this_obj_conv;
27707 this_obj_conv.inner = untag_ptr(this_obj);
27708 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27709 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27710 Record_free(this_obj_conv);
27713 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Record_1get_1level(JNIEnv *env, jclass clz, int64_t this_ptr) {
27714 LDKRecord this_ptr_conv;
27715 this_ptr_conv.inner = untag_ptr(this_ptr);
27716 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27717 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27718 this_ptr_conv.is_owned = false;
27719 jclass ret_conv = LDKLevel_to_java(env, Record_get_level(&this_ptr_conv));
27723 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1level(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) {
27724 LDKRecord this_ptr_conv;
27725 this_ptr_conv.inner = untag_ptr(this_ptr);
27726 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27727 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27728 this_ptr_conv.is_owned = false;
27729 LDKLevel val_conv = LDKLevel_from_java(env, val);
27730 Record_set_level(&this_ptr_conv, val_conv);
27733 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1args(JNIEnv *env, jclass clz, int64_t this_ptr) {
27734 LDKRecord this_ptr_conv;
27735 this_ptr_conv.inner = untag_ptr(this_ptr);
27736 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27737 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27738 this_ptr_conv.is_owned = false;
27739 LDKStr ret_str = Record_get_args(&this_ptr_conv);
27740 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
27745 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1args(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
27746 LDKRecord this_ptr_conv;
27747 this_ptr_conv.inner = untag_ptr(this_ptr);
27748 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27749 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27750 this_ptr_conv.is_owned = false;
27751 LDKStr val_conv = java_to_owned_str(env, val);
27752 Record_set_args(&this_ptr_conv, val_conv);
27755 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr) {
27756 LDKRecord this_ptr_conv;
27757 this_ptr_conv.inner = untag_ptr(this_ptr);
27758 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27759 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27760 this_ptr_conv.is_owned = false;
27761 LDKStr ret_str = Record_get_module_path(&this_ptr_conv);
27762 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
27767 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1module_1path(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
27768 LDKRecord this_ptr_conv;
27769 this_ptr_conv.inner = untag_ptr(this_ptr);
27770 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27771 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27772 this_ptr_conv.is_owned = false;
27773 LDKStr val_conv = java_to_owned_str(env, val);
27774 Record_set_module_path(&this_ptr_conv, val_conv);
27777 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Record_1get_1file(JNIEnv *env, jclass clz, int64_t this_ptr) {
27778 LDKRecord this_ptr_conv;
27779 this_ptr_conv.inner = untag_ptr(this_ptr);
27780 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27781 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27782 this_ptr_conv.is_owned = false;
27783 LDKStr ret_str = Record_get_file(&this_ptr_conv);
27784 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
27789 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1file(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
27790 LDKRecord this_ptr_conv;
27791 this_ptr_conv.inner = untag_ptr(this_ptr);
27792 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27793 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27794 this_ptr_conv.is_owned = false;
27795 LDKStr val_conv = java_to_owned_str(env, val);
27796 Record_set_file(&this_ptr_conv, val_conv);
27799 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_Record_1get_1line(JNIEnv *env, jclass clz, int64_t this_ptr) {
27800 LDKRecord this_ptr_conv;
27801 this_ptr_conv.inner = untag_ptr(this_ptr);
27802 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27803 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27804 this_ptr_conv.is_owned = false;
27805 int32_t ret_conv = Record_get_line(&this_ptr_conv);
27809 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Record_1set_1line(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
27810 LDKRecord this_ptr_conv;
27811 this_ptr_conv.inner = untag_ptr(this_ptr);
27812 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27813 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27814 this_ptr_conv.is_owned = false;
27815 Record_set_line(&this_ptr_conv, val);
27818 static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) {
27819 LDKRecord ret_var = Record_clone(arg);
27820 int64_t ret_ref = 0;
27821 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27822 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27825 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
27826 LDKRecord arg_conv;
27827 arg_conv.inner = untag_ptr(arg);
27828 arg_conv.is_owned = ptr_is_owned(arg);
27829 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27830 arg_conv.is_owned = false;
27831 int64_t ret_conv = Record_clone_ptr(&arg_conv);
27835 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Record_1clone(JNIEnv *env, jclass clz, int64_t orig) {
27836 LDKRecord orig_conv;
27837 orig_conv.inner = untag_ptr(orig);
27838 orig_conv.is_owned = ptr_is_owned(orig);
27839 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27840 orig_conv.is_owned = false;
27841 LDKRecord ret_var = Record_clone(&orig_conv);
27842 int64_t ret_ref = 0;
27843 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27844 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27848 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
27849 if (!ptr_is_owned(this_ptr)) return;
27850 void* this_ptr_ptr = untag_ptr(this_ptr);
27851 CHECK_ACCESS(this_ptr_ptr);
27852 LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr);
27853 FREE(untag_ptr(this_ptr));
27854 Logger_free(this_ptr_conv);
27857 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
27858 LDKChannelHandshakeConfig this_obj_conv;
27859 this_obj_conv.inner = untag_ptr(this_obj);
27860 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27861 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27862 ChannelHandshakeConfig_free(this_obj_conv);
27865 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) {
27866 LDKChannelHandshakeConfig this_ptr_conv;
27867 this_ptr_conv.inner = untag_ptr(this_ptr);
27868 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27869 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27870 this_ptr_conv.is_owned = false;
27871 int32_t ret_conv = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv);
27875 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
27876 LDKChannelHandshakeConfig this_ptr_conv;
27877 this_ptr_conv.inner = untag_ptr(this_ptr);
27878 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27879 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27880 this_ptr_conv.is_owned = false;
27881 ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val);
27884 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
27885 LDKChannelHandshakeConfig this_ptr_conv;
27886 this_ptr_conv.inner = untag_ptr(this_ptr);
27887 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27888 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27889 this_ptr_conv.is_owned = false;
27890 int16_t ret_conv = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv);
27894 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) {
27895 LDKChannelHandshakeConfig this_ptr_conv;
27896 this_ptr_conv.inner = untag_ptr(this_ptr);
27897 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27898 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27899 this_ptr_conv.is_owned = false;
27900 ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val);
27903 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
27904 LDKChannelHandshakeConfig this_ptr_conv;
27905 this_ptr_conv.inner = untag_ptr(this_ptr);
27906 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27907 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27908 this_ptr_conv.is_owned = false;
27909 int64_t ret_conv = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv);
27913 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) {
27914 LDKChannelHandshakeConfig this_ptr_conv;
27915 this_ptr_conv.inner = untag_ptr(this_ptr);
27916 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27917 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27918 this_ptr_conv.is_owned = false;
27919 ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val);
27922 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) {
27923 LDKChannelHandshakeConfig this_ptr_conv;
27924 this_ptr_conv.inner = untag_ptr(this_ptr);
27925 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27926 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27927 this_ptr_conv.is_owned = false;
27928 int8_t ret_conv = ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv);
27932 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) {
27933 LDKChannelHandshakeConfig this_ptr_conv;
27934 this_ptr_conv.inner = untag_ptr(this_ptr);
27935 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27936 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27937 this_ptr_conv.is_owned = false;
27938 ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv, val);
27941 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1negotiate_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_ptr) {
27942 LDKChannelHandshakeConfig this_ptr_conv;
27943 this_ptr_conv.inner = untag_ptr(this_ptr);
27944 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27945 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27946 this_ptr_conv.is_owned = false;
27947 jboolean ret_conv = ChannelHandshakeConfig_get_negotiate_scid_privacy(&this_ptr_conv);
27951 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1negotiate_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
27952 LDKChannelHandshakeConfig this_ptr_conv;
27953 this_ptr_conv.inner = untag_ptr(this_ptr);
27954 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27955 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27956 this_ptr_conv.is_owned = false;
27957 ChannelHandshakeConfig_set_negotiate_scid_privacy(&this_ptr_conv, val);
27960 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr) {
27961 LDKChannelHandshakeConfig this_ptr_conv;
27962 this_ptr_conv.inner = untag_ptr(this_ptr);
27963 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27964 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27965 this_ptr_conv.is_owned = false;
27966 jboolean ret_conv = ChannelHandshakeConfig_get_announced_channel(&this_ptr_conv);
27970 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1announced_1channel(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
27971 LDKChannelHandshakeConfig this_ptr_conv;
27972 this_ptr_conv.inner = untag_ptr(this_ptr);
27973 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27974 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27975 this_ptr_conv.is_owned = false;
27976 ChannelHandshakeConfig_set_announced_channel(&this_ptr_conv, val);
27979 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
27980 LDKChannelHandshakeConfig this_ptr_conv;
27981 this_ptr_conv.inner = untag_ptr(this_ptr);
27982 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27983 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27984 this_ptr_conv.is_owned = false;
27985 jboolean ret_conv = ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv);
27989 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
27990 LDKChannelHandshakeConfig this_ptr_conv;
27991 this_ptr_conv.inner = untag_ptr(this_ptr);
27992 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27993 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27994 this_ptr_conv.is_owned = false;
27995 ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val);
27998 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1their_1channel_1reserve_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
27999 LDKChannelHandshakeConfig this_ptr_conv;
28000 this_ptr_conv.inner = untag_ptr(this_ptr);
28001 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28002 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28003 this_ptr_conv.is_owned = false;
28004 int32_t ret_conv = ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(&this_ptr_conv);
28008 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) {
28009 LDKChannelHandshakeConfig this_ptr_conv;
28010 this_ptr_conv.inner = untag_ptr(this_ptr);
28011 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28012 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28013 this_ptr_conv.is_owned = false;
28014 ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(&this_ptr_conv, val);
28017 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
28018 LDKChannelHandshakeConfig this_ptr_conv;
28019 this_ptr_conv.inner = untag_ptr(this_ptr);
28020 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28021 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28022 this_ptr_conv.is_owned = false;
28023 int16_t ret_conv = ChannelHandshakeConfig_get_our_max_accepted_htlcs(&this_ptr_conv);
28027 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
28028 LDKChannelHandshakeConfig this_ptr_conv;
28029 this_ptr_conv.inner = untag_ptr(this_ptr);
28030 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28031 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28032 this_ptr_conv.is_owned = false;
28033 ChannelHandshakeConfig_set_our_max_accepted_htlcs(&this_ptr_conv, val);
28036 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, int16_t our_max_accepted_htlcs_arg) {
28037 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, our_max_accepted_htlcs_arg);
28038 int64_t ret_ref = 0;
28039 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28040 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28044 static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) {
28045 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg);
28046 int64_t ret_ref = 0;
28047 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28048 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28051 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
28052 LDKChannelHandshakeConfig arg_conv;
28053 arg_conv.inner = untag_ptr(arg);
28054 arg_conv.is_owned = ptr_is_owned(arg);
28055 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28056 arg_conv.is_owned = false;
28057 int64_t ret_conv = ChannelHandshakeConfig_clone_ptr(&arg_conv);
28061 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28062 LDKChannelHandshakeConfig orig_conv;
28063 orig_conv.inner = untag_ptr(orig);
28064 orig_conv.is_owned = ptr_is_owned(orig);
28065 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28066 orig_conv.is_owned = false;
28067 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv);
28068 int64_t ret_ref = 0;
28069 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28070 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28074 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv *env, jclass clz) {
28075 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default();
28076 int64_t ret_ref = 0;
28077 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28078 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28082 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
28083 LDKChannelHandshakeLimits this_obj_conv;
28084 this_obj_conv.inner = untag_ptr(this_obj);
28085 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28086 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28087 ChannelHandshakeLimits_free(this_obj_conv);
28090 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
28091 LDKChannelHandshakeLimits this_ptr_conv;
28092 this_ptr_conv.inner = untag_ptr(this_ptr);
28093 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28094 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28095 this_ptr_conv.is_owned = false;
28096 int64_t ret_conv = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv);
28100 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28101 LDKChannelHandshakeLimits this_ptr_conv;
28102 this_ptr_conv.inner = untag_ptr(this_ptr);
28103 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28104 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28105 this_ptr_conv.is_owned = false;
28106 ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val);
28109 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
28110 LDKChannelHandshakeLimits this_ptr_conv;
28111 this_ptr_conv.inner = untag_ptr(this_ptr);
28112 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28113 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28114 this_ptr_conv.is_owned = false;
28115 int64_t ret_conv = ChannelHandshakeLimits_get_max_funding_satoshis(&this_ptr_conv);
28119 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28120 LDKChannelHandshakeLimits this_ptr_conv;
28121 this_ptr_conv.inner = untag_ptr(this_ptr);
28122 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28123 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28124 this_ptr_conv.is_owned = false;
28125 ChannelHandshakeLimits_set_max_funding_satoshis(&this_ptr_conv, val);
28128 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
28129 LDKChannelHandshakeLimits this_ptr_conv;
28130 this_ptr_conv.inner = untag_ptr(this_ptr);
28131 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28132 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28133 this_ptr_conv.is_owned = false;
28134 int64_t ret_conv = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv);
28138 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) {
28139 LDKChannelHandshakeLimits this_ptr_conv;
28140 this_ptr_conv.inner = untag_ptr(this_ptr);
28141 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28142 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28143 this_ptr_conv.is_owned = false;
28144 ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val);
28147 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) {
28148 LDKChannelHandshakeLimits this_ptr_conv;
28149 this_ptr_conv.inner = untag_ptr(this_ptr);
28150 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28151 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28152 this_ptr_conv.is_owned = false;
28153 int64_t ret_conv = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv);
28157 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) {
28158 LDKChannelHandshakeLimits this_ptr_conv;
28159 this_ptr_conv.inner = untag_ptr(this_ptr);
28160 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28161 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28162 this_ptr_conv.is_owned = false;
28163 ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
28166 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
28167 LDKChannelHandshakeLimits this_ptr_conv;
28168 this_ptr_conv.inner = untag_ptr(this_ptr);
28169 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28170 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28171 this_ptr_conv.is_owned = false;
28172 int64_t ret_conv = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv);
28176 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) {
28177 LDKChannelHandshakeLimits this_ptr_conv;
28178 this_ptr_conv.inner = untag_ptr(this_ptr);
28179 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28180 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28181 this_ptr_conv.is_owned = false;
28182 ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val);
28185 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
28186 LDKChannelHandshakeLimits this_ptr_conv;
28187 this_ptr_conv.inner = untag_ptr(this_ptr);
28188 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28189 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28190 this_ptr_conv.is_owned = false;
28191 int16_t ret_conv = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv);
28195 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) {
28196 LDKChannelHandshakeLimits this_ptr_conv;
28197 this_ptr_conv.inner = untag_ptr(this_ptr);
28198 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28199 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28200 this_ptr_conv.is_owned = false;
28201 ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val);
28204 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) {
28205 LDKChannelHandshakeLimits this_ptr_conv;
28206 this_ptr_conv.inner = untag_ptr(this_ptr);
28207 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28208 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28209 this_ptr_conv.is_owned = false;
28210 int32_t ret_conv = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv);
28214 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
28215 LDKChannelHandshakeLimits this_ptr_conv;
28216 this_ptr_conv.inner = untag_ptr(this_ptr);
28217 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28218 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28219 this_ptr_conv.is_owned = false;
28220 ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val);
28223 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1trust_1own_1funding_10conf(JNIEnv *env, jclass clz, int64_t this_ptr) {
28224 LDKChannelHandshakeLimits this_ptr_conv;
28225 this_ptr_conv.inner = untag_ptr(this_ptr);
28226 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28227 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28228 this_ptr_conv.is_owned = false;
28229 jboolean ret_conv = ChannelHandshakeLimits_get_trust_own_funding_0conf(&this_ptr_conv);
28233 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1trust_1own_1funding_10conf(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
28234 LDKChannelHandshakeLimits this_ptr_conv;
28235 this_ptr_conv.inner = untag_ptr(this_ptr);
28236 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28237 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28238 this_ptr_conv.is_owned = false;
28239 ChannelHandshakeLimits_set_trust_own_funding_0conf(&this_ptr_conv, val);
28242 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv *env, jclass clz, int64_t this_ptr) {
28243 LDKChannelHandshakeLimits this_ptr_conv;
28244 this_ptr_conv.inner = untag_ptr(this_ptr);
28245 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28246 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28247 this_ptr_conv.is_owned = false;
28248 jboolean ret_conv = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv);
28252 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
28253 LDKChannelHandshakeLimits this_ptr_conv;
28254 this_ptr_conv.inner = untag_ptr(this_ptr);
28255 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28256 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28257 this_ptr_conv.is_owned = false;
28258 ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val);
28261 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
28262 LDKChannelHandshakeLimits this_ptr_conv;
28263 this_ptr_conv.inner = untag_ptr(this_ptr);
28264 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28265 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28266 this_ptr_conv.is_owned = false;
28267 int16_t ret_conv = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv);
28271 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) {
28272 LDKChannelHandshakeLimits this_ptr_conv;
28273 this_ptr_conv.inner = untag_ptr(this_ptr);
28274 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28276 this_ptr_conv.is_owned = false;
28277 ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val);
28280 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) {
28281 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);
28282 int64_t ret_ref = 0;
28283 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28284 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28288 static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) {
28289 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg);
28290 int64_t ret_ref = 0;
28291 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28292 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28295 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
28296 LDKChannelHandshakeLimits arg_conv;
28297 arg_conv.inner = untag_ptr(arg);
28298 arg_conv.is_owned = ptr_is_owned(arg);
28299 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28300 arg_conv.is_owned = false;
28301 int64_t ret_conv = ChannelHandshakeLimits_clone_ptr(&arg_conv);
28305 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28306 LDKChannelHandshakeLimits orig_conv;
28307 orig_conv.inner = untag_ptr(orig);
28308 orig_conv.is_owned = ptr_is_owned(orig);
28309 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28310 orig_conv.is_owned = false;
28311 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv);
28312 int64_t ret_ref = 0;
28313 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28314 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28318 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv *env, jclass clz) {
28319 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_default();
28320 int64_t ret_ref = 0;
28321 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28322 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28326 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
28327 LDKChannelConfig this_obj_conv;
28328 this_obj_conv.inner = untag_ptr(this_obj);
28329 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28330 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28331 ChannelConfig_free(this_obj_conv);
28334 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forwarding_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
28335 LDKChannelConfig this_ptr_conv;
28336 this_ptr_conv.inner = untag_ptr(this_ptr);
28337 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28338 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28339 this_ptr_conv.is_owned = false;
28340 int32_t ret_conv = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv);
28344 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) {
28345 LDKChannelConfig this_ptr_conv;
28346 this_ptr_conv.inner = untag_ptr(this_ptr);
28347 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28348 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28349 this_ptr_conv.is_owned = false;
28350 ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val);
28353 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1forwarding_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
28354 LDKChannelConfig this_ptr_conv;
28355 this_ptr_conv.inner = untag_ptr(this_ptr);
28356 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28357 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28358 this_ptr_conv.is_owned = false;
28359 int32_t ret_conv = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv);
28363 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) {
28364 LDKChannelConfig this_ptr_conv;
28365 this_ptr_conv.inner = untag_ptr(this_ptr);
28366 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28367 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28368 this_ptr_conv.is_owned = false;
28369 ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val);
28372 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
28373 LDKChannelConfig this_ptr_conv;
28374 this_ptr_conv.inner = untag_ptr(this_ptr);
28375 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28376 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28377 this_ptr_conv.is_owned = false;
28378 int16_t ret_conv = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv);
28382 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
28383 LDKChannelConfig this_ptr_conv;
28384 this_ptr_conv.inner = untag_ptr(this_ptr);
28385 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28386 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28387 this_ptr_conv.is_owned = false;
28388 ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val);
28391 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1max_1dust_1htlc_1exposure_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
28392 LDKChannelConfig this_ptr_conv;
28393 this_ptr_conv.inner = untag_ptr(this_ptr);
28394 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28395 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28396 this_ptr_conv.is_owned = false;
28397 int64_t ret_conv = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv);
28401 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) {
28402 LDKChannelConfig this_ptr_conv;
28403 this_ptr_conv.inner = untag_ptr(this_ptr);
28404 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28405 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28406 this_ptr_conv.is_owned = false;
28407 ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val);
28410 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) {
28411 LDKChannelConfig this_ptr_conv;
28412 this_ptr_conv.inner = untag_ptr(this_ptr);
28413 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28414 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28415 this_ptr_conv.is_owned = false;
28416 int64_t ret_conv = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv);
28420 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) {
28421 LDKChannelConfig this_ptr_conv;
28422 this_ptr_conv.inner = untag_ptr(this_ptr);
28423 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28424 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28425 this_ptr_conv.is_owned = false;
28426 ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val);
28429 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) {
28430 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);
28431 int64_t ret_ref = 0;
28432 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28433 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28437 static inline uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) {
28438 LDKChannelConfig ret_var = ChannelConfig_clone(arg);
28439 int64_t ret_ref = 0;
28440 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28441 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28444 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
28445 LDKChannelConfig arg_conv;
28446 arg_conv.inner = untag_ptr(arg);
28447 arg_conv.is_owned = ptr_is_owned(arg);
28448 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28449 arg_conv.is_owned = false;
28450 int64_t ret_conv = ChannelConfig_clone_ptr(&arg_conv);
28454 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28455 LDKChannelConfig orig_conv;
28456 orig_conv.inner = untag_ptr(orig);
28457 orig_conv.is_owned = ptr_is_owned(orig);
28458 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28459 orig_conv.is_owned = false;
28460 LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv);
28461 int64_t ret_ref = 0;
28462 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28463 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28467 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
28468 LDKChannelConfig a_conv;
28469 a_conv.inner = untag_ptr(a);
28470 a_conv.is_owned = ptr_is_owned(a);
28471 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
28472 a_conv.is_owned = false;
28473 LDKChannelConfig b_conv;
28474 b_conv.inner = untag_ptr(b);
28475 b_conv.is_owned = ptr_is_owned(b);
28476 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
28477 b_conv.is_owned = false;
28478 jboolean ret_conv = ChannelConfig_eq(&a_conv, &b_conv);
28482 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv *env, jclass clz) {
28483 LDKChannelConfig ret_var = ChannelConfig_default();
28484 int64_t ret_ref = 0;
28485 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28486 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28490 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv *env, jclass clz, int64_t obj) {
28491 LDKChannelConfig obj_conv;
28492 obj_conv.inner = untag_ptr(obj);
28493 obj_conv.is_owned = ptr_is_owned(obj);
28494 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
28495 obj_conv.is_owned = false;
28496 LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv);
28497 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
28498 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
28499 CVec_u8Z_free(ret_var);
28503 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
28504 LDKu8slice ser_ref;
28505 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
28506 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
28507 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
28508 *ret_conv = ChannelConfig_read(ser_ref);
28509 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
28510 return tag_ptr(ret_conv, true);
28513 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
28514 LDKUserConfig this_obj_conv;
28515 this_obj_conv.inner = untag_ptr(this_obj);
28516 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28517 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28518 UserConfig_free(this_obj_conv);
28521 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1handshake_1config(JNIEnv *env, jclass clz, int64_t this_ptr) {
28522 LDKUserConfig this_ptr_conv;
28523 this_ptr_conv.inner = untag_ptr(this_ptr);
28524 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28525 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28526 this_ptr_conv.is_owned = false;
28527 LDKChannelHandshakeConfig ret_var = UserConfig_get_channel_handshake_config(&this_ptr_conv);
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 void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1handshake_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28535 LDKUserConfig this_ptr_conv;
28536 this_ptr_conv.inner = untag_ptr(this_ptr);
28537 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28538 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28539 this_ptr_conv.is_owned = false;
28540 LDKChannelHandshakeConfig val_conv;
28541 val_conv.inner = untag_ptr(val);
28542 val_conv.is_owned = ptr_is_owned(val);
28543 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28544 val_conv = ChannelHandshakeConfig_clone(&val_conv);
28545 UserConfig_set_channel_handshake_config(&this_ptr_conv, val_conv);
28548 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1handshake_1limits(JNIEnv *env, jclass clz, int64_t this_ptr) {
28549 LDKUserConfig this_ptr_conv;
28550 this_ptr_conv.inner = untag_ptr(this_ptr);
28551 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28552 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28553 this_ptr_conv.is_owned = false;
28554 LDKChannelHandshakeLimits ret_var = UserConfig_get_channel_handshake_limits(&this_ptr_conv);
28555 int64_t ret_ref = 0;
28556 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28557 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28561 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1handshake_1limits(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28562 LDKUserConfig this_ptr_conv;
28563 this_ptr_conv.inner = untag_ptr(this_ptr);
28564 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28565 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28566 this_ptr_conv.is_owned = false;
28567 LDKChannelHandshakeLimits val_conv;
28568 val_conv.inner = untag_ptr(val);
28569 val_conv.is_owned = ptr_is_owned(val);
28570 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28571 val_conv = ChannelHandshakeLimits_clone(&val_conv);
28572 UserConfig_set_channel_handshake_limits(&this_ptr_conv, val_conv);
28575 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1config(JNIEnv *env, jclass clz, int64_t this_ptr) {
28576 LDKUserConfig this_ptr_conv;
28577 this_ptr_conv.inner = untag_ptr(this_ptr);
28578 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28579 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28580 this_ptr_conv.is_owned = false;
28581 LDKChannelConfig ret_var = UserConfig_get_channel_config(&this_ptr_conv);
28582 int64_t ret_ref = 0;
28583 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28584 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28588 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28589 LDKUserConfig this_ptr_conv;
28590 this_ptr_conv.inner = untag_ptr(this_ptr);
28591 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28592 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28593 this_ptr_conv.is_owned = false;
28594 LDKChannelConfig val_conv;
28595 val_conv.inner = untag_ptr(val);
28596 val_conv.is_owned = ptr_is_owned(val);
28597 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28598 val_conv = ChannelConfig_clone(&val_conv);
28599 UserConfig_set_channel_config(&this_ptr_conv, val_conv);
28602 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1forwards_1to_1priv_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
28603 LDKUserConfig this_ptr_conv;
28604 this_ptr_conv.inner = untag_ptr(this_ptr);
28605 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28606 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28607 this_ptr_conv.is_owned = false;
28608 jboolean ret_conv = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv);
28612 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) {
28613 LDKUserConfig this_ptr_conv;
28614 this_ptr_conv.inner = untag_ptr(this_ptr);
28615 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28616 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28617 this_ptr_conv.is_owned = false;
28618 UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val);
28621 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
28622 LDKUserConfig this_ptr_conv;
28623 this_ptr_conv.inner = untag_ptr(this_ptr);
28624 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28625 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28626 this_ptr_conv.is_owned = false;
28627 jboolean ret_conv = UserConfig_get_accept_inbound_channels(&this_ptr_conv);
28631 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
28632 LDKUserConfig this_ptr_conv;
28633 this_ptr_conv.inner = untag_ptr(this_ptr);
28634 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28635 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28636 this_ptr_conv.is_owned = false;
28637 UserConfig_set_accept_inbound_channels(&this_ptr_conv, val);
28640 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1manually_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
28641 LDKUserConfig this_ptr_conv;
28642 this_ptr_conv.inner = untag_ptr(this_ptr);
28643 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28644 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28645 this_ptr_conv.is_owned = false;
28646 jboolean ret_conv = UserConfig_get_manually_accept_inbound_channels(&this_ptr_conv);
28650 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1manually_1accept_1inbound_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
28651 LDKUserConfig this_ptr_conv;
28652 this_ptr_conv.inner = untag_ptr(this_ptr);
28653 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28654 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28655 this_ptr_conv.is_owned = false;
28656 UserConfig_set_manually_accept_inbound_channels(&this_ptr_conv, val);
28659 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1intercept_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
28660 LDKUserConfig this_ptr_conv;
28661 this_ptr_conv.inner = untag_ptr(this_ptr);
28662 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28663 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28664 this_ptr_conv.is_owned = false;
28665 jboolean ret_conv = UserConfig_get_accept_intercept_htlcs(&this_ptr_conv);
28669 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1intercept_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
28670 LDKUserConfig this_ptr_conv;
28671 this_ptr_conv.inner = untag_ptr(this_ptr);
28672 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28673 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28674 this_ptr_conv.is_owned = false;
28675 UserConfig_set_accept_intercept_htlcs(&this_ptr_conv, val);
28678 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) {
28679 LDKChannelHandshakeConfig channel_handshake_config_arg_conv;
28680 channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg);
28681 channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg);
28682 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_config_arg_conv);
28683 channel_handshake_config_arg_conv = ChannelHandshakeConfig_clone(&channel_handshake_config_arg_conv);
28684 LDKChannelHandshakeLimits channel_handshake_limits_arg_conv;
28685 channel_handshake_limits_arg_conv.inner = untag_ptr(channel_handshake_limits_arg);
28686 channel_handshake_limits_arg_conv.is_owned = ptr_is_owned(channel_handshake_limits_arg);
28687 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_limits_arg_conv);
28688 channel_handshake_limits_arg_conv = ChannelHandshakeLimits_clone(&channel_handshake_limits_arg_conv);
28689 LDKChannelConfig channel_config_arg_conv;
28690 channel_config_arg_conv.inner = untag_ptr(channel_config_arg);
28691 channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg);
28692 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv);
28693 channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv);
28694 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);
28695 int64_t ret_ref = 0;
28696 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28697 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28701 static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) {
28702 LDKUserConfig ret_var = UserConfig_clone(arg);
28703 int64_t ret_ref = 0;
28704 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28705 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28708 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
28709 LDKUserConfig arg_conv;
28710 arg_conv.inner = untag_ptr(arg);
28711 arg_conv.is_owned = ptr_is_owned(arg);
28712 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28713 arg_conv.is_owned = false;
28714 int64_t ret_conv = UserConfig_clone_ptr(&arg_conv);
28718 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28719 LDKUserConfig orig_conv;
28720 orig_conv.inner = untag_ptr(orig);
28721 orig_conv.is_owned = ptr_is_owned(orig);
28722 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28723 orig_conv.is_owned = false;
28724 LDKUserConfig ret_var = UserConfig_clone(&orig_conv);
28725 int64_t ret_ref = 0;
28726 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28727 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28731 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv *env, jclass clz) {
28732 LDKUserConfig ret_var = UserConfig_default();
28733 int64_t ret_ref = 0;
28734 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28735 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28739 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BestBlock_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
28740 LDKBestBlock this_obj_conv;
28741 this_obj_conv.inner = untag_ptr(this_obj);
28742 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28743 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28744 BestBlock_free(this_obj_conv);
28747 static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) {
28748 LDKBestBlock ret_var = BestBlock_clone(arg);
28749 int64_t ret_ref = 0;
28750 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28751 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28754 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
28755 LDKBestBlock arg_conv;
28756 arg_conv.inner = untag_ptr(arg);
28757 arg_conv.is_owned = ptr_is_owned(arg);
28758 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28759 arg_conv.is_owned = false;
28760 int64_t ret_conv = BestBlock_clone_ptr(&arg_conv);
28764 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28765 LDKBestBlock orig_conv;
28766 orig_conv.inner = untag_ptr(orig);
28767 orig_conv.is_owned = ptr_is_owned(orig);
28768 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28769 orig_conv.is_owned = false;
28770 LDKBestBlock ret_var = BestBlock_clone(&orig_conv);
28771 int64_t ret_ref = 0;
28772 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28773 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28777 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BestBlock_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
28778 LDKBestBlock a_conv;
28779 a_conv.inner = untag_ptr(a);
28780 a_conv.is_owned = ptr_is_owned(a);
28781 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
28782 a_conv.is_owned = false;
28783 LDKBestBlock b_conv;
28784 b_conv.inner = untag_ptr(b);
28785 b_conv.is_owned = ptr_is_owned(b);
28786 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
28787 b_conv.is_owned = false;
28788 jboolean ret_conv = BestBlock_eq(&a_conv, &b_conv);
28792 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1from_1network(JNIEnv *env, jclass clz, jclass network) {
28793 LDKNetwork network_conv = LDKNetwork_from_java(env, network);
28794 LDKBestBlock ret_var = BestBlock_from_network(network_conv);
28795 int64_t ret_ref = 0;
28796 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28797 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28801 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1new(JNIEnv *env, jclass clz, int8_tArray block_hash, int32_t height) {
28802 LDKThirtyTwoBytes block_hash_ref;
28803 CHECK((*env)->GetArrayLength(env, block_hash) == 32);
28804 (*env)->GetByteArrayRegion(env, block_hash, 0, 32, block_hash_ref.data);
28805 LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height);
28806 int64_t ret_ref = 0;
28807 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28808 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28812 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BestBlock_1block_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
28813 LDKBestBlock this_arg_conv;
28814 this_arg_conv.inner = untag_ptr(this_arg);
28815 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28816 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28817 this_arg_conv.is_owned = false;
28818 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
28819 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BestBlock_block_hash(&this_arg_conv).data);
28823 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1height(JNIEnv *env, jclass clz, int64_t this_arg) {
28824 LDKBestBlock this_arg_conv;
28825 this_arg_conv.inner = untag_ptr(this_arg);
28826 this_arg_conv.is_owned = ptr_is_owned(this_arg);
28827 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
28828 this_arg_conv.is_owned = false;
28829 int32_t ret_conv = BestBlock_height(&this_arg_conv);
28833 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Listen_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
28834 if (!ptr_is_owned(this_ptr)) return;
28835 void* this_ptr_ptr = untag_ptr(this_ptr);
28836 CHECK_ACCESS(this_ptr_ptr);
28837 LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr);
28838 FREE(untag_ptr(this_ptr));
28839 Listen_free(this_ptr_conv);
28842 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
28843 if (!ptr_is_owned(this_ptr)) return;
28844 void* this_ptr_ptr = untag_ptr(this_ptr);
28845 CHECK_ACCESS(this_ptr_ptr);
28846 LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr);
28847 FREE(untag_ptr(this_ptr));
28848 Confirm_free(this_ptr_conv);
28851 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1clone(JNIEnv *env, jclass clz, int64_t orig) {
28852 LDKChannelMonitorUpdateStatus* orig_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(orig);
28853 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_clone(orig_conv));
28857 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1completed(JNIEnv *env, jclass clz) {
28858 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_completed());
28862 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1in_1progress(JNIEnv *env, jclass clz) {
28863 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_in_progress());
28867 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1permanent_1failure(JNIEnv *env, jclass clz) {
28868 jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_permanent_failure());
28872 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
28873 LDKChannelMonitorUpdateStatus* a_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(a);
28874 LDKChannelMonitorUpdateStatus* b_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(b);
28875 jboolean ret_conv = ChannelMonitorUpdateStatus_eq(a_conv, b_conv);
28879 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
28880 if (!ptr_is_owned(this_ptr)) return;
28881 void* this_ptr_ptr = untag_ptr(this_ptr);
28882 CHECK_ACCESS(this_ptr_ptr);
28883 LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr);
28884 FREE(untag_ptr(this_ptr));
28885 Watch_free(this_ptr_conv);
28888 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
28889 if (!ptr_is_owned(this_ptr)) return;
28890 void* this_ptr_ptr = untag_ptr(this_ptr);
28891 CHECK_ACCESS(this_ptr_ptr);
28892 LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr);
28893 FREE(untag_ptr(this_ptr));
28894 Filter_free(this_ptr_conv);
28897 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
28898 LDKWatchedOutput this_obj_conv;
28899 this_obj_conv.inner = untag_ptr(this_obj);
28900 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28901 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28902 WatchedOutput_free(this_obj_conv);
28905 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1block_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
28906 LDKWatchedOutput this_ptr_conv;
28907 this_ptr_conv.inner = untag_ptr(this_ptr);
28908 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28909 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28910 this_ptr_conv.is_owned = false;
28911 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
28912 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, WatchedOutput_get_block_hash(&this_ptr_conv).data);
28916 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1block_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
28917 LDKWatchedOutput this_ptr_conv;
28918 this_ptr_conv.inner = untag_ptr(this_ptr);
28919 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28920 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28921 this_ptr_conv.is_owned = false;
28922 LDKThirtyTwoBytes val_ref;
28923 CHECK((*env)->GetArrayLength(env, val) == 32);
28924 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
28925 WatchedOutput_set_block_hash(&this_ptr_conv, val_ref);
28928 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
28929 LDKWatchedOutput this_ptr_conv;
28930 this_ptr_conv.inner = untag_ptr(this_ptr);
28931 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28932 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28933 this_ptr_conv.is_owned = false;
28934 LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv);
28935 int64_t ret_ref = 0;
28936 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28937 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28941 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
28942 LDKWatchedOutput this_ptr_conv;
28943 this_ptr_conv.inner = untag_ptr(this_ptr);
28944 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28945 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28946 this_ptr_conv.is_owned = false;
28947 LDKOutPoint val_conv;
28948 val_conv.inner = untag_ptr(val);
28949 val_conv.is_owned = ptr_is_owned(val);
28950 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28951 val_conv = OutPoint_clone(&val_conv);
28952 WatchedOutput_set_outpoint(&this_ptr_conv, val_conv);
28955 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1get_1script_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
28956 LDKWatchedOutput this_ptr_conv;
28957 this_ptr_conv.inner = untag_ptr(this_ptr);
28958 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28959 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28960 this_ptr_conv.is_owned = false;
28961 LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv);
28962 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
28963 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
28967 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1set_1script_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
28968 LDKWatchedOutput this_ptr_conv;
28969 this_ptr_conv.inner = untag_ptr(this_ptr);
28970 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28971 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28972 this_ptr_conv.is_owned = false;
28973 LDKCVec_u8Z val_ref;
28974 val_ref.datalen = (*env)->GetArrayLength(env, val);
28975 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
28976 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
28977 WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref);
28980 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) {
28981 LDKThirtyTwoBytes block_hash_arg_ref;
28982 CHECK((*env)->GetArrayLength(env, block_hash_arg) == 32);
28983 (*env)->GetByteArrayRegion(env, block_hash_arg, 0, 32, block_hash_arg_ref.data);
28984 LDKOutPoint outpoint_arg_conv;
28985 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
28986 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
28987 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
28988 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
28989 LDKCVec_u8Z script_pubkey_arg_ref;
28990 script_pubkey_arg_ref.datalen = (*env)->GetArrayLength(env, script_pubkey_arg);
28991 script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
28992 (*env)->GetByteArrayRegion(env, script_pubkey_arg, 0, script_pubkey_arg_ref.datalen, script_pubkey_arg_ref.data);
28993 LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref);
28994 int64_t ret_ref = 0;
28995 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28996 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29000 static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) {
29001 LDKWatchedOutput ret_var = WatchedOutput_clone(arg);
29002 int64_t ret_ref = 0;
29003 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29004 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29007 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29008 LDKWatchedOutput arg_conv;
29009 arg_conv.inner = untag_ptr(arg);
29010 arg_conv.is_owned = ptr_is_owned(arg);
29011 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29012 arg_conv.is_owned = false;
29013 int64_t ret_conv = WatchedOutput_clone_ptr(&arg_conv);
29017 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29018 LDKWatchedOutput orig_conv;
29019 orig_conv.inner = untag_ptr(orig);
29020 orig_conv.is_owned = ptr_is_owned(orig);
29021 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29022 orig_conv.is_owned = false;
29023 LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv);
29024 int64_t ret_ref = 0;
29025 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29026 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29030 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
29031 LDKWatchedOutput a_conv;
29032 a_conv.inner = untag_ptr(a);
29033 a_conv.is_owned = ptr_is_owned(a);
29034 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29035 a_conv.is_owned = false;
29036 LDKWatchedOutput b_conv;
29037 b_conv.inner = untag_ptr(b);
29038 b_conv.is_owned = ptr_is_owned(b);
29039 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
29040 b_conv.is_owned = false;
29041 jboolean ret_conv = WatchedOutput_eq(&a_conv, &b_conv);
29045 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1hash(JNIEnv *env, jclass clz, int64_t o) {
29046 LDKWatchedOutput o_conv;
29047 o_conv.inner = untag_ptr(o);
29048 o_conv.is_owned = ptr_is_owned(o);
29049 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
29050 o_conv.is_owned = false;
29051 int64_t ret_conv = WatchedOutput_hash(&o_conv);
29055 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
29056 if (!ptr_is_owned(this_ptr)) return;
29057 void* this_ptr_ptr = untag_ptr(this_ptr);
29058 CHECK_ACCESS(this_ptr_ptr);
29059 LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr);
29060 FREE(untag_ptr(this_ptr));
29061 BroadcasterInterface_free(this_ptr_conv);
29064 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29065 LDKConfirmationTarget* orig_conv = (LDKConfirmationTarget*)untag_ptr(orig);
29066 jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_clone(orig_conv));
29070 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1background(JNIEnv *env, jclass clz) {
29071 jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_background());
29075 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1normal(JNIEnv *env, jclass clz) {
29076 jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_normal());
29080 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1high_1priority(JNIEnv *env, jclass clz) {
29081 jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_high_priority());
29085 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1hash(JNIEnv *env, jclass clz, int64_t o) {
29086 LDKConfirmationTarget* o_conv = (LDKConfirmationTarget*)untag_ptr(o);
29087 int64_t ret_conv = ConfirmationTarget_hash(o_conv);
29091 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
29092 LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)untag_ptr(a);
29093 LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)untag_ptr(b);
29094 jboolean ret_conv = ConfirmationTarget_eq(a_conv, b_conv);
29098 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
29099 if (!ptr_is_owned(this_ptr)) return;
29100 void* this_ptr_ptr = untag_ptr(this_ptr);
29101 CHECK_ACCESS(this_ptr_ptr);
29102 LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr);
29103 FREE(untag_ptr(this_ptr));
29104 FeeEstimator_free(this_ptr_conv);
29107 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
29108 LDKMonitorUpdateId this_obj_conv;
29109 this_obj_conv.inner = untag_ptr(this_obj);
29110 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29111 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29112 MonitorUpdateId_free(this_obj_conv);
29115 static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) {
29116 LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg);
29117 int64_t ret_ref = 0;
29118 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29119 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29122 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29123 LDKMonitorUpdateId arg_conv;
29124 arg_conv.inner = untag_ptr(arg);
29125 arg_conv.is_owned = ptr_is_owned(arg);
29126 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29127 arg_conv.is_owned = false;
29128 int64_t ret_conv = MonitorUpdateId_clone_ptr(&arg_conv);
29132 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29133 LDKMonitorUpdateId orig_conv;
29134 orig_conv.inner = untag_ptr(orig);
29135 orig_conv.is_owned = ptr_is_owned(orig);
29136 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29137 orig_conv.is_owned = false;
29138 LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv);
29139 int64_t ret_ref = 0;
29140 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29141 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29145 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1hash(JNIEnv *env, jclass clz, int64_t o) {
29146 LDKMonitorUpdateId o_conv;
29147 o_conv.inner = untag_ptr(o);
29148 o_conv.is_owned = ptr_is_owned(o);
29149 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
29150 o_conv.is_owned = false;
29151 int64_t ret_conv = MonitorUpdateId_hash(&o_conv);
29155 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorUpdateId_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
29156 LDKMonitorUpdateId a_conv;
29157 a_conv.inner = untag_ptr(a);
29158 a_conv.is_owned = ptr_is_owned(a);
29159 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29160 a_conv.is_owned = false;
29161 LDKMonitorUpdateId b_conv;
29162 b_conv.inner = untag_ptr(b);
29163 b_conv.is_owned = ptr_is_owned(b);
29164 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
29165 b_conv.is_owned = false;
29166 jboolean ret_conv = MonitorUpdateId_eq(&a_conv, &b_conv);
29170 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persist_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
29171 if (!ptr_is_owned(this_ptr)) return;
29172 void* this_ptr_ptr = untag_ptr(this_ptr);
29173 CHECK_ACCESS(this_ptr_ptr);
29174 LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr);
29175 FREE(untag_ptr(this_ptr));
29176 Persist_free(this_ptr_conv);
29179 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedChannelMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
29180 LDKLockedChannelMonitor this_obj_conv;
29181 this_obj_conv.inner = untag_ptr(this_obj);
29182 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29183 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29184 LockedChannelMonitor_free(this_obj_conv);
29187 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
29188 LDKChainMonitor this_obj_conv;
29189 this_obj_conv.inner = untag_ptr(this_obj);
29190 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29191 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29192 ChainMonitor_free(this_obj_conv);
29195 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) {
29196 void* chain_source_ptr = untag_ptr(chain_source);
29197 CHECK_ACCESS(chain_source_ptr);
29198 LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr);
29199 // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ
29200 if (chain_source_conv.tag == LDKCOption_FilterZ_Some) {
29201 // Manually implement clone for Java trait instances
29202 if (chain_source_conv.some.free == LDKFilter_JCalls_free) {
29203 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
29204 LDKFilter_JCalls_cloned(&chain_source_conv.some);
29207 void* broadcaster_ptr = untag_ptr(broadcaster);
29208 CHECK_ACCESS(broadcaster_ptr);
29209 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
29210 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
29211 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
29212 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
29214 void* logger_ptr = untag_ptr(logger);
29215 CHECK_ACCESS(logger_ptr);
29216 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
29217 if (logger_conv.free == LDKLogger_JCalls_free) {
29218 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
29219 LDKLogger_JCalls_cloned(&logger_conv);
29221 void* feeest_ptr = untag_ptr(feeest);
29222 CHECK_ACCESS(feeest_ptr);
29223 LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr);
29224 if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
29225 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
29226 LDKFeeEstimator_JCalls_cloned(&feeest_conv);
29228 void* persister_ptr = untag_ptr(persister);
29229 CHECK_ACCESS(persister_ptr);
29230 LDKPersist persister_conv = *(LDKPersist*)(persister_ptr);
29231 if (persister_conv.free == LDKPersist_JCalls_free) {
29232 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
29233 LDKPersist_JCalls_cloned(&persister_conv);
29235 LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv);
29236 int64_t ret_ref = 0;
29237 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29238 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29242 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) {
29243 LDKChainMonitor this_arg_conv;
29244 this_arg_conv.inner = untag_ptr(this_arg);
29245 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29246 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29247 this_arg_conv.is_owned = false;
29248 LDKCVec_ChannelDetailsZ ignored_channels_constr;
29249 ignored_channels_constr.datalen = (*env)->GetArrayLength(env, ignored_channels);
29250 if (ignored_channels_constr.datalen > 0)
29251 ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
29253 ignored_channels_constr.data = NULL;
29254 int64_t* ignored_channels_vals = (*env)->GetLongArrayElements (env, ignored_channels, NULL);
29255 for (size_t q = 0; q < ignored_channels_constr.datalen; q++) {
29256 int64_t ignored_channels_conv_16 = ignored_channels_vals[q];
29257 LDKChannelDetails ignored_channels_conv_16_conv;
29258 ignored_channels_conv_16_conv.inner = untag_ptr(ignored_channels_conv_16);
29259 ignored_channels_conv_16_conv.is_owned = ptr_is_owned(ignored_channels_conv_16);
29260 CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv);
29261 ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv);
29262 ignored_channels_constr.data[q] = ignored_channels_conv_16_conv;
29264 (*env)->ReleaseLongArrayElements(env, ignored_channels, ignored_channels_vals, 0);
29265 LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr);
29266 int64_tArray ret_arr = NULL;
29267 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
29268 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
29269 for (size_t j = 0; j < ret_var.datalen; j++) {
29270 LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
29271 *ret_conv_9_copy = ret_var.data[j];
29272 int64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true);
29273 ret_arr_ptr[j] = ret_conv_9_ref;
29275 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
29276 FREE(ret_var.data);
29280 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1monitor(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo) {
29281 LDKChainMonitor this_arg_conv;
29282 this_arg_conv.inner = untag_ptr(this_arg);
29283 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29284 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29285 this_arg_conv.is_owned = false;
29286 LDKOutPoint funding_txo_conv;
29287 funding_txo_conv.inner = untag_ptr(funding_txo);
29288 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
29289 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
29290 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
29291 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
29292 *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv);
29293 return tag_ptr(ret_conv, true);
29296 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1monitors(JNIEnv *env, jclass clz, int64_t this_arg) {
29297 LDKChainMonitor this_arg_conv;
29298 this_arg_conv.inner = untag_ptr(this_arg);
29299 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29300 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29301 this_arg_conv.is_owned = false;
29302 LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv);
29303 int64_tArray ret_arr = NULL;
29304 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
29305 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
29306 for (size_t k = 0; k < ret_var.datalen; k++) {
29307 LDKOutPoint ret_conv_10_var = ret_var.data[k];
29308 int64_t ret_conv_10_ref = 0;
29309 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var);
29310 ret_conv_10_ref = tag_ptr(ret_conv_10_var.inner, ret_conv_10_var.is_owned);
29311 ret_arr_ptr[k] = ret_conv_10_ref;
29313 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
29314 FREE(ret_var.data);
29318 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1pending_1monitor_1updates(JNIEnv *env, jclass clz, int64_t this_arg) {
29319 LDKChainMonitor this_arg_conv;
29320 this_arg_conv.inner = untag_ptr(this_arg);
29321 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29322 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29323 this_arg_conv.is_owned = false;
29324 LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret_var = ChainMonitor_list_pending_monitor_updates(&this_arg_conv);
29325 int64_tArray ret_arr = NULL;
29326 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
29327 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
29328 for (size_t p = 0; p < ret_var.datalen; p++) {
29329 LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv_41_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ");
29330 *ret_conv_41_conv = ret_var.data[p];
29331 ret_arr_ptr[p] = tag_ptr(ret_conv_41_conv, true);
29333 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
29334 FREE(ret_var.data);
29338 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) {
29339 LDKChainMonitor this_arg_conv;
29340 this_arg_conv.inner = untag_ptr(this_arg);
29341 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29342 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29343 this_arg_conv.is_owned = false;
29344 LDKOutPoint funding_txo_conv;
29345 funding_txo_conv.inner = untag_ptr(funding_txo);
29346 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
29347 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
29348 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
29349 LDKMonitorUpdateId completed_update_id_conv;
29350 completed_update_id_conv.inner = untag_ptr(completed_update_id);
29351 completed_update_id_conv.is_owned = ptr_is_owned(completed_update_id);
29352 CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv);
29353 completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv);
29354 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
29355 *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv);
29356 return tag_ptr(ret_conv, true);
29359 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1update_1future(JNIEnv *env, jclass clz, int64_t this_arg) {
29360 LDKChainMonitor this_arg_conv;
29361 this_arg_conv.inner = untag_ptr(this_arg);
29362 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29363 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29364 this_arg_conv.is_owned = false;
29365 LDKFuture ret_var = ChainMonitor_get_update_future(&this_arg_conv);
29366 int64_t ret_ref = 0;
29367 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29368 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29372 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1rebroadcast_1pending_1claims(JNIEnv *env, jclass clz, int64_t this_arg) {
29373 LDKChainMonitor this_arg_conv;
29374 this_arg_conv.inner = untag_ptr(this_arg);
29375 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29376 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29377 this_arg_conv.is_owned = false;
29378 ChainMonitor_rebroadcast_pending_claims(&this_arg_conv);
29381 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Listen(JNIEnv *env, jclass clz, int64_t this_arg) {
29382 LDKChainMonitor this_arg_conv;
29383 this_arg_conv.inner = untag_ptr(this_arg);
29384 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29385 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29386 this_arg_conv.is_owned = false;
29387 LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
29388 *ret_ret = ChainMonitor_as_Listen(&this_arg_conv);
29389 return tag_ptr(ret_ret, true);
29392 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Confirm(JNIEnv *env, jclass clz, int64_t this_arg) {
29393 LDKChainMonitor this_arg_conv;
29394 this_arg_conv.inner = untag_ptr(this_arg);
29395 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29396 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29397 this_arg_conv.is_owned = false;
29398 LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
29399 *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv);
29400 return tag_ptr(ret_ret, true);
29403 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(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 LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
29410 *ret_ret = ChainMonitor_as_Watch(&this_arg_conv);
29411 return tag_ptr(ret_ret, true);
29414 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsProvider(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 LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
29421 *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv);
29422 return tag_ptr(ret_ret, true);
29425 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
29426 LDKChannelMonitorUpdate this_obj_conv;
29427 this_obj_conv.inner = untag_ptr(this_obj);
29428 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29429 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29430 ChannelMonitorUpdate_free(this_obj_conv);
29433 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
29434 LDKChannelMonitorUpdate this_ptr_conv;
29435 this_ptr_conv.inner = untag_ptr(this_ptr);
29436 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29437 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29438 this_ptr_conv.is_owned = false;
29439 int64_t ret_conv = ChannelMonitorUpdate_get_update_id(&this_ptr_conv);
29443 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
29444 LDKChannelMonitorUpdate this_ptr_conv;
29445 this_ptr_conv.inner = untag_ptr(this_ptr);
29446 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29447 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29448 this_ptr_conv.is_owned = false;
29449 ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val);
29452 static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) {
29453 LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg);
29454 int64_t ret_ref = 0;
29455 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29456 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29459 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29460 LDKChannelMonitorUpdate arg_conv;
29461 arg_conv.inner = untag_ptr(arg);
29462 arg_conv.is_owned = ptr_is_owned(arg);
29463 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29464 arg_conv.is_owned = false;
29465 int64_t ret_conv = ChannelMonitorUpdate_clone_ptr(&arg_conv);
29469 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29470 LDKChannelMonitorUpdate orig_conv;
29471 orig_conv.inner = untag_ptr(orig);
29472 orig_conv.is_owned = ptr_is_owned(orig);
29473 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29474 orig_conv.is_owned = false;
29475 LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv);
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);
29482 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
29483 LDKChannelMonitorUpdate a_conv;
29484 a_conv.inner = untag_ptr(a);
29485 a_conv.is_owned = ptr_is_owned(a);
29486 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29487 a_conv.is_owned = false;
29488 LDKChannelMonitorUpdate b_conv;
29489 b_conv.inner = untag_ptr(b);
29490 b_conv.is_owned = ptr_is_owned(b);
29491 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
29492 b_conv.is_owned = false;
29493 jboolean ret_conv = ChannelMonitorUpdate_eq(&a_conv, &b_conv);
29497 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
29498 LDKChannelMonitorUpdate obj_conv;
29499 obj_conv.inner = untag_ptr(obj);
29500 obj_conv.is_owned = ptr_is_owned(obj);
29501 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
29502 obj_conv.is_owned = false;
29503 LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv);
29504 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
29505 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
29506 CVec_u8Z_free(ret_var);
29510 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
29511 LDKu8slice ser_ref;
29512 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
29513 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
29514 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
29515 *ret_conv = ChannelMonitorUpdate_read(ser_ref);
29516 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
29517 return tag_ptr(ret_conv, true);
29520 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
29521 if (!ptr_is_owned(this_ptr)) return;
29522 void* this_ptr_ptr = untag_ptr(this_ptr);
29523 CHECK_ACCESS(this_ptr_ptr);
29524 LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr);
29525 FREE(untag_ptr(this_ptr));
29526 MonitorEvent_free(this_ptr_conv);
29529 static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) {
29530 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
29531 *ret_copy = MonitorEvent_clone(arg);
29532 int64_t ret_ref = tag_ptr(ret_copy, true);
29535 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29536 LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)untag_ptr(arg);
29537 int64_t ret_conv = MonitorEvent_clone_ptr(arg_conv);
29541 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29542 LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)untag_ptr(orig);
29543 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
29544 *ret_copy = MonitorEvent_clone(orig_conv);
29545 int64_t ret_ref = tag_ptr(ret_copy, true);
29549 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1htlcevent(JNIEnv *env, jclass clz, int64_t a) {
29550 LDKHTLCUpdate a_conv;
29551 a_conv.inner = untag_ptr(a);
29552 a_conv.is_owned = ptr_is_owned(a);
29553 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29554 a_conv = HTLCUpdate_clone(&a_conv);
29555 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
29556 *ret_copy = MonitorEvent_htlcevent(a_conv);
29557 int64_t ret_ref = tag_ptr(ret_copy, true);
29561 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1commitment_1tx_1confirmed(JNIEnv *env, jclass clz, int64_t a) {
29562 LDKOutPoint a_conv;
29563 a_conv.inner = untag_ptr(a);
29564 a_conv.is_owned = ptr_is_owned(a);
29565 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29566 a_conv = OutPoint_clone(&a_conv);
29567 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
29568 *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv);
29569 int64_t ret_ref = tag_ptr(ret_copy, true);
29573 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1completed(JNIEnv *env, jclass clz, int64_t funding_txo, int64_t monitor_update_id) {
29574 LDKOutPoint funding_txo_conv;
29575 funding_txo_conv.inner = untag_ptr(funding_txo);
29576 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
29577 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
29578 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
29579 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
29580 *ret_copy = MonitorEvent_completed(funding_txo_conv, monitor_update_id);
29581 int64_t ret_ref = tag_ptr(ret_copy, true);
29585 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1failed(JNIEnv *env, jclass clz, int64_t a) {
29586 LDKOutPoint a_conv;
29587 a_conv.inner = untag_ptr(a);
29588 a_conv.is_owned = ptr_is_owned(a);
29589 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29590 a_conv = OutPoint_clone(&a_conv);
29591 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
29592 *ret_copy = MonitorEvent_update_failed(a_conv);
29593 int64_t ret_ref = tag_ptr(ret_copy, true);
29597 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
29598 LDKMonitorEvent* a_conv = (LDKMonitorEvent*)untag_ptr(a);
29599 LDKMonitorEvent* b_conv = (LDKMonitorEvent*)untag_ptr(b);
29600 jboolean ret_conv = MonitorEvent_eq(a_conv, b_conv);
29604 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1write(JNIEnv *env, jclass clz, int64_t obj) {
29605 LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)untag_ptr(obj);
29606 LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv);
29607 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
29608 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
29609 CVec_u8Z_free(ret_var);
29613 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
29614 LDKu8slice ser_ref;
29615 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
29616 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
29617 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
29618 *ret_conv = MonitorEvent_read(ser_ref);
29619 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
29620 return tag_ptr(ret_conv, true);
29623 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
29624 LDKHTLCUpdate this_obj_conv;
29625 this_obj_conv.inner = untag_ptr(this_obj);
29626 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29627 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29628 HTLCUpdate_free(this_obj_conv);
29631 static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) {
29632 LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg);
29633 int64_t ret_ref = 0;
29634 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29635 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29638 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29639 LDKHTLCUpdate arg_conv;
29640 arg_conv.inner = untag_ptr(arg);
29641 arg_conv.is_owned = ptr_is_owned(arg);
29642 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29643 arg_conv.is_owned = false;
29644 int64_t ret_conv = HTLCUpdate_clone_ptr(&arg_conv);
29648 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29649 LDKHTLCUpdate orig_conv;
29650 orig_conv.inner = untag_ptr(orig);
29651 orig_conv.is_owned = ptr_is_owned(orig);
29652 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29653 orig_conv.is_owned = false;
29654 LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv);
29655 int64_t ret_ref = 0;
29656 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29657 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29661 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
29662 LDKHTLCUpdate a_conv;
29663 a_conv.inner = untag_ptr(a);
29664 a_conv.is_owned = ptr_is_owned(a);
29665 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
29666 a_conv.is_owned = false;
29667 LDKHTLCUpdate b_conv;
29668 b_conv.inner = untag_ptr(b);
29669 b_conv.is_owned = ptr_is_owned(b);
29670 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
29671 b_conv.is_owned = false;
29672 jboolean ret_conv = HTLCUpdate_eq(&a_conv, &b_conv);
29676 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
29677 LDKHTLCUpdate obj_conv;
29678 obj_conv.inner = untag_ptr(obj);
29679 obj_conv.is_owned = ptr_is_owned(obj);
29680 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
29681 obj_conv.is_owned = false;
29682 LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv);
29683 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
29684 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
29685 CVec_u8Z_free(ret_var);
29689 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
29690 LDKu8slice ser_ref;
29691 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
29692 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
29693 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
29694 *ret_conv = HTLCUpdate_read(ser_ref);
29695 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
29696 return tag_ptr(ret_conv, true);
29699 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Balance_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
29700 if (!ptr_is_owned(this_ptr)) return;
29701 void* this_ptr_ptr = untag_ptr(this_ptr);
29702 CHECK_ACCESS(this_ptr_ptr);
29703 LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr);
29704 FREE(untag_ptr(this_ptr));
29705 Balance_free(this_ptr_conv);
29708 static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) {
29709 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
29710 *ret_copy = Balance_clone(arg);
29711 int64_t ret_ref = tag_ptr(ret_copy, true);
29714 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29715 LDKBalance* arg_conv = (LDKBalance*)untag_ptr(arg);
29716 int64_t ret_conv = Balance_clone_ptr(arg_conv);
29720 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29721 LDKBalance* orig_conv = (LDKBalance*)untag_ptr(orig);
29722 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
29723 *ret_copy = Balance_clone(orig_conv);
29724 int64_t ret_ref = tag_ptr(ret_copy, true);
29728 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1claimable_1on_1channel_1close(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis) {
29729 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
29730 *ret_copy = Balance_claimable_on_channel_close(claimable_amount_satoshis);
29731 int64_t ret_ref = tag_ptr(ret_copy, true);
29735 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) {
29736 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
29737 *ret_copy = Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height);
29738 int64_t ret_ref = tag_ptr(ret_copy, true);
29742 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) {
29743 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
29744 *ret_copy = Balance_contentious_claimable(claimable_amount_satoshis, timeout_height);
29745 int64_t ret_ref = tag_ptr(ret_copy, true);
29749 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) {
29750 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
29751 *ret_copy = Balance_maybe_timeout_claimable_htlc(claimable_amount_satoshis, claimable_height);
29752 int64_t ret_ref = tag_ptr(ret_copy, true);
29756 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) {
29757 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
29758 *ret_copy = Balance_maybe_preimage_claimable_htlc(claimable_amount_satoshis, expiry_height);
29759 int64_t ret_ref = tag_ptr(ret_copy, true);
29763 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Balance_1counterparty_1revoked_1output_1claimable(JNIEnv *env, jclass clz, int64_t claimable_amount_satoshis) {
29764 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
29765 *ret_copy = Balance_counterparty_revoked_output_claimable(claimable_amount_satoshis);
29766 int64_t ret_ref = tag_ptr(ret_copy, true);
29770 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Balance_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
29771 LDKBalance* a_conv = (LDKBalance*)untag_ptr(a);
29772 LDKBalance* b_conv = (LDKBalance*)untag_ptr(b);
29773 jboolean ret_conv = Balance_eq(a_conv, b_conv);
29777 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
29778 LDKChannelMonitor this_obj_conv;
29779 this_obj_conv.inner = untag_ptr(this_obj);
29780 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29781 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29782 ChannelMonitor_free(this_obj_conv);
29785 static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) {
29786 LDKChannelMonitor ret_var = ChannelMonitor_clone(arg);
29787 int64_t ret_ref = 0;
29788 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29789 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29792 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
29793 LDKChannelMonitor arg_conv;
29794 arg_conv.inner = untag_ptr(arg);
29795 arg_conv.is_owned = ptr_is_owned(arg);
29796 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29797 arg_conv.is_owned = false;
29798 int64_t ret_conv = ChannelMonitor_clone_ptr(&arg_conv);
29802 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
29803 LDKChannelMonitor orig_conv;
29804 orig_conv.inner = untag_ptr(orig);
29805 orig_conv.is_owned = ptr_is_owned(orig);
29806 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29807 orig_conv.is_owned = false;
29808 LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv);
29809 int64_t ret_ref = 0;
29810 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29811 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29815 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1write(JNIEnv *env, jclass clz, int64_t obj) {
29816 LDKChannelMonitor obj_conv;
29817 obj_conv.inner = untag_ptr(obj);
29818 obj_conv.is_owned = ptr_is_owned(obj);
29819 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
29820 obj_conv.is_owned = false;
29821 LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv);
29822 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
29823 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
29824 CVec_u8Z_free(ret_var);
29828 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) {
29829 LDKChannelMonitor this_arg_conv;
29830 this_arg_conv.inner = untag_ptr(this_arg);
29831 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29832 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29833 this_arg_conv.is_owned = false;
29834 LDKChannelMonitorUpdate updates_conv;
29835 updates_conv.inner = untag_ptr(updates);
29836 updates_conv.is_owned = ptr_is_owned(updates);
29837 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
29838 updates_conv.is_owned = false;
29839 void* broadcaster_ptr = untag_ptr(broadcaster);
29840 if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); }
29841 LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr;
29842 void* fee_estimator_ptr = untag_ptr(fee_estimator);
29843 CHECK_ACCESS(fee_estimator_ptr);
29844 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
29845 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
29846 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
29847 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
29849 void* logger_ptr = untag_ptr(logger);
29850 if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); }
29851 LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
29852 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
29853 *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv);
29854 return tag_ptr(ret_conv, true);
29857 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
29858 LDKChannelMonitor this_arg_conv;
29859 this_arg_conv.inner = untag_ptr(this_arg);
29860 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29861 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29862 this_arg_conv.is_owned = false;
29863 int64_t ret_conv = ChannelMonitor_get_latest_update_id(&this_arg_conv);
29867 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_arg) {
29868 LDKChannelMonitor this_arg_conv;
29869 this_arg_conv.inner = untag_ptr(this_arg);
29870 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29871 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29872 this_arg_conv.is_owned = false;
29873 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
29874 *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv);
29875 return tag_ptr(ret_conv, true);
29878 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1outputs_1to_1watch(JNIEnv *env, jclass clz, int64_t this_arg) {
29879 LDKChannelMonitor this_arg_conv;
29880 this_arg_conv.inner = untag_ptr(this_arg);
29881 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29882 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29883 this_arg_conv.is_owned = false;
29884 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv);
29885 int64_tArray ret_arr = NULL;
29886 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
29887 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
29888 for (size_t o = 0; o < ret_var.datalen; o++) {
29889 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
29890 *ret_conv_40_conv = ret_var.data[o];
29891 ret_arr_ptr[o] = tag_ptr(ret_conv_40_conv, true);
29893 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
29894 FREE(ret_var.data);
29898 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1load_1outputs_1to_1watch(JNIEnv *env, jclass clz, int64_t this_arg, int64_t filter) {
29899 LDKChannelMonitor this_arg_conv;
29900 this_arg_conv.inner = untag_ptr(this_arg);
29901 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29902 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29903 this_arg_conv.is_owned = false;
29904 void* filter_ptr = untag_ptr(filter);
29905 if (ptr_is_owned(filter)) { CHECK_ACCESS(filter_ptr); }
29906 LDKFilter* filter_conv = (LDKFilter*)filter_ptr;
29907 ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv);
29910 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
29911 LDKChannelMonitor this_arg_conv;
29912 this_arg_conv.inner = untag_ptr(this_arg);
29913 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29914 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29915 this_arg_conv.is_owned = false;
29916 LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv);
29917 int64_tArray ret_arr = NULL;
29918 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
29919 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
29920 for (size_t o = 0; o < ret_var.datalen; o++) {
29921 LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
29922 *ret_conv_14_copy = ret_var.data[o];
29923 int64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true);
29924 ret_arr_ptr[o] = ret_conv_14_ref;
29926 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
29927 FREE(ret_var.data);
29931 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
29932 LDKChannelMonitor this_arg_conv;
29933 this_arg_conv.inner = untag_ptr(this_arg);
29934 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29935 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29936 this_arg_conv.is_owned = false;
29937 LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv);
29938 int64_tArray ret_arr = NULL;
29939 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
29940 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
29941 for (size_t h = 0; h < ret_var.datalen; h++) {
29942 LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
29943 *ret_conv_7_copy = ret_var.data[h];
29944 int64_t ret_conv_7_ref = tag_ptr(ret_conv_7_copy, true);
29945 ret_arr_ptr[h] = ret_conv_7_ref;
29947 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
29948 FREE(ret_var.data);
29952 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1counterparty_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
29953 LDKChannelMonitor this_arg_conv;
29954 this_arg_conv.inner = untag_ptr(this_arg);
29955 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29956 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29957 this_arg_conv.is_owned = false;
29958 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
29959 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelMonitor_get_counterparty_node_id(&this_arg_conv).compressed_form);
29963 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) {
29964 LDKChannelMonitor this_arg_conv;
29965 this_arg_conv.inner = untag_ptr(this_arg);
29966 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29967 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29968 this_arg_conv.is_owned = false;
29969 void* logger_ptr = untag_ptr(logger);
29970 if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); }
29971 LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
29972 LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv);
29973 jobjectArray ret_arr = NULL;
29974 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
29976 for (size_t i = 0; i < ret_var.datalen; i++) {
29977 LDKTransaction ret_conv_8_var = ret_var.data[i];
29978 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, ret_conv_8_var.datalen);
29979 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, ret_conv_8_var.datalen, ret_conv_8_var.data);
29980 Transaction_free(ret_conv_8_var);
29981 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
29984 FREE(ret_var.data);
29988 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) {
29989 LDKChannelMonitor this_arg_conv;
29990 this_arg_conv.inner = untag_ptr(this_arg);
29991 this_arg_conv.is_owned = ptr_is_owned(this_arg);
29992 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
29993 this_arg_conv.is_owned = false;
29994 uint8_t header_arr[80];
29995 CHECK((*env)->GetArrayLength(env, header) == 80);
29996 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
29997 uint8_t (*header_ref)[80] = &header_arr;
29998 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
29999 txdata_constr.datalen = (*env)->GetArrayLength(env, txdata);
30000 if (txdata_constr.datalen > 0)
30001 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
30003 txdata_constr.data = NULL;
30004 int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
30005 for (size_t c = 0; c < txdata_constr.datalen; c++) {
30006 int64_t txdata_conv_28 = txdata_vals[c];
30007 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
30008 CHECK_ACCESS(txdata_conv_28_ptr);
30009 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
30010 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
30011 txdata_constr.data[c] = txdata_conv_28_conv;
30013 (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
30014 void* broadcaster_ptr = untag_ptr(broadcaster);
30015 CHECK_ACCESS(broadcaster_ptr);
30016 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
30017 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
30018 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30019 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
30021 void* fee_estimator_ptr = untag_ptr(fee_estimator);
30022 CHECK_ACCESS(fee_estimator_ptr);
30023 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
30024 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
30025 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30026 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
30028 void* logger_ptr = untag_ptr(logger);
30029 CHECK_ACCESS(logger_ptr);
30030 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
30031 if (logger_conv.free == LDKLogger_JCalls_free) {
30032 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30033 LDKLogger_JCalls_cloned(&logger_conv);
30035 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);
30036 int64_tArray ret_arr = NULL;
30037 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
30038 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
30039 for (size_t n = 0; n < ret_var.datalen; n++) {
30040 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
30041 *ret_conv_39_conv = ret_var.data[n];
30042 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
30044 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
30045 FREE(ret_var.data);
30049 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) {
30050 LDKChannelMonitor this_arg_conv;
30051 this_arg_conv.inner = untag_ptr(this_arg);
30052 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30053 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30054 this_arg_conv.is_owned = false;
30055 uint8_t header_arr[80];
30056 CHECK((*env)->GetArrayLength(env, header) == 80);
30057 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
30058 uint8_t (*header_ref)[80] = &header_arr;
30059 void* broadcaster_ptr = untag_ptr(broadcaster);
30060 CHECK_ACCESS(broadcaster_ptr);
30061 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
30062 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
30063 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30064 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
30066 void* fee_estimator_ptr = untag_ptr(fee_estimator);
30067 CHECK_ACCESS(fee_estimator_ptr);
30068 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
30069 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
30070 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30071 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
30073 void* logger_ptr = untag_ptr(logger);
30074 CHECK_ACCESS(logger_ptr);
30075 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
30076 if (logger_conv.free == LDKLogger_JCalls_free) {
30077 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30078 LDKLogger_JCalls_cloned(&logger_conv);
30080 ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
30083 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) {
30084 LDKChannelMonitor this_arg_conv;
30085 this_arg_conv.inner = untag_ptr(this_arg);
30086 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30087 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30088 this_arg_conv.is_owned = false;
30089 uint8_t header_arr[80];
30090 CHECK((*env)->GetArrayLength(env, header) == 80);
30091 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
30092 uint8_t (*header_ref)[80] = &header_arr;
30093 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
30094 txdata_constr.datalen = (*env)->GetArrayLength(env, txdata);
30095 if (txdata_constr.datalen > 0)
30096 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
30098 txdata_constr.data = NULL;
30099 int64_t* txdata_vals = (*env)->GetLongArrayElements (env, txdata, NULL);
30100 for (size_t c = 0; c < txdata_constr.datalen; c++) {
30101 int64_t txdata_conv_28 = txdata_vals[c];
30102 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
30103 CHECK_ACCESS(txdata_conv_28_ptr);
30104 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
30105 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
30106 txdata_constr.data[c] = txdata_conv_28_conv;
30108 (*env)->ReleaseLongArrayElements(env, txdata, txdata_vals, 0);
30109 void* broadcaster_ptr = untag_ptr(broadcaster);
30110 CHECK_ACCESS(broadcaster_ptr);
30111 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
30112 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
30113 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30114 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
30116 void* fee_estimator_ptr = untag_ptr(fee_estimator);
30117 CHECK_ACCESS(fee_estimator_ptr);
30118 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
30119 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
30120 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30121 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
30123 void* logger_ptr = untag_ptr(logger);
30124 CHECK_ACCESS(logger_ptr);
30125 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
30126 if (logger_conv.free == LDKLogger_JCalls_free) {
30127 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30128 LDKLogger_JCalls_cloned(&logger_conv);
30130 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);
30131 int64_tArray ret_arr = NULL;
30132 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
30133 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
30134 for (size_t n = 0; n < ret_var.datalen; n++) {
30135 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
30136 *ret_conv_39_conv = ret_var.data[n];
30137 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
30139 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
30140 FREE(ret_var.data);
30144 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) {
30145 LDKChannelMonitor this_arg_conv;
30146 this_arg_conv.inner = untag_ptr(this_arg);
30147 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30148 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30149 this_arg_conv.is_owned = false;
30150 uint8_t txid_arr[32];
30151 CHECK((*env)->GetArrayLength(env, txid) == 32);
30152 (*env)->GetByteArrayRegion(env, txid, 0, 32, txid_arr);
30153 uint8_t (*txid_ref)[32] = &txid_arr;
30154 void* broadcaster_ptr = untag_ptr(broadcaster);
30155 CHECK_ACCESS(broadcaster_ptr);
30156 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
30157 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
30158 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30159 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
30161 void* fee_estimator_ptr = untag_ptr(fee_estimator);
30162 CHECK_ACCESS(fee_estimator_ptr);
30163 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
30164 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
30165 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30166 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
30168 void* logger_ptr = untag_ptr(logger);
30169 CHECK_ACCESS(logger_ptr);
30170 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
30171 if (logger_conv.free == LDKLogger_JCalls_free) {
30172 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30173 LDKLogger_JCalls_cloned(&logger_conv);
30175 ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv);
30178 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) {
30179 LDKChannelMonitor this_arg_conv;
30180 this_arg_conv.inner = untag_ptr(this_arg);
30181 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30182 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30183 this_arg_conv.is_owned = false;
30184 uint8_t header_arr[80];
30185 CHECK((*env)->GetArrayLength(env, header) == 80);
30186 (*env)->GetByteArrayRegion(env, header, 0, 80, header_arr);
30187 uint8_t (*header_ref)[80] = &header_arr;
30188 void* broadcaster_ptr = untag_ptr(broadcaster);
30189 CHECK_ACCESS(broadcaster_ptr);
30190 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
30191 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
30192 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30193 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
30195 void* fee_estimator_ptr = untag_ptr(fee_estimator);
30196 CHECK_ACCESS(fee_estimator_ptr);
30197 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
30198 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
30199 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30200 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
30202 void* logger_ptr = untag_ptr(logger);
30203 CHECK_ACCESS(logger_ptr);
30204 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
30205 if (logger_conv.free == LDKLogger_JCalls_free) {
30206 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30207 LDKLogger_JCalls_cloned(&logger_conv);
30209 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
30210 int64_tArray ret_arr = NULL;
30211 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
30212 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
30213 for (size_t n = 0; n < ret_var.datalen; n++) {
30214 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
30215 *ret_conv_39_conv = ret_var.data[n];
30216 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
30218 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
30219 FREE(ret_var.data);
30223 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) {
30224 LDKChannelMonitor this_arg_conv;
30225 this_arg_conv.inner = untag_ptr(this_arg);
30226 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30227 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30228 this_arg_conv.is_owned = false;
30229 LDKCVec_C2Tuple_TxidBlockHashZZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv);
30230 int64_tArray ret_arr = NULL;
30231 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
30232 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
30233 for (size_t z = 0; z < ret_var.datalen; z++) {
30234 LDKC2Tuple_TxidBlockHashZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ");
30235 *ret_conv_25_conv = ret_var.data[z];
30236 ret_arr_ptr[z] = tag_ptr(ret_conv_25_conv, true);
30238 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
30239 FREE(ret_var.data);
30243 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1current_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg) {
30244 LDKChannelMonitor this_arg_conv;
30245 this_arg_conv.inner = untag_ptr(this_arg);
30246 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30247 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30248 this_arg_conv.is_owned = false;
30249 LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv);
30250 int64_t ret_ref = 0;
30251 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30252 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30256 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1rebroadcast_1pending_1claims(JNIEnv *env, jclass clz, int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, int64_t logger) {
30257 LDKChannelMonitor this_arg_conv;
30258 this_arg_conv.inner = untag_ptr(this_arg);
30259 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30260 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30261 this_arg_conv.is_owned = false;
30262 void* broadcaster_ptr = untag_ptr(broadcaster);
30263 CHECK_ACCESS(broadcaster_ptr);
30264 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
30265 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
30266 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30267 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
30269 void* fee_estimator_ptr = untag_ptr(fee_estimator);
30270 CHECK_ACCESS(fee_estimator_ptr);
30271 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
30272 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
30273 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30274 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
30276 void* logger_ptr = untag_ptr(logger);
30277 CHECK_ACCESS(logger_ptr);
30278 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
30279 if (logger_conv.free == LDKLogger_JCalls_free) {
30280 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
30281 LDKLogger_JCalls_cloned(&logger_conv);
30283 ChannelMonitor_rebroadcast_pending_claims(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv);
30286 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1claimable_1balances(JNIEnv *env, jclass clz, int64_t this_arg) {
30287 LDKChannelMonitor this_arg_conv;
30288 this_arg_conv.inner = untag_ptr(this_arg);
30289 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30290 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30291 this_arg_conv.is_owned = false;
30292 LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv);
30293 int64_tArray ret_arr = NULL;
30294 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
30295 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
30296 for (size_t j = 0; j < ret_var.datalen; j++) {
30297 LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
30298 *ret_conv_9_copy = ret_var.data[j];
30299 int64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true);
30300 ret_arr_ptr[j] = ret_conv_9_ref;
30302 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
30303 FREE(ret_var.data);
30307 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) {
30308 LDKu8slice ser_ref;
30309 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
30310 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
30311 void* arg_a_ptr = untag_ptr(arg_a);
30312 if (ptr_is_owned(arg_a)) { CHECK_ACCESS(arg_a_ptr); }
30313 LDKEntropySource* arg_a_conv = (LDKEntropySource*)arg_a_ptr;
30314 void* arg_b_ptr = untag_ptr(arg_b);
30315 if (ptr_is_owned(arg_b)) { CHECK_ACCESS(arg_b_ptr); }
30316 LDKSignerProvider* arg_b_conv = (LDKSignerProvider*)arg_b_ptr;
30317 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
30318 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_a_conv, arg_b_conv);
30319 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
30320 return tag_ptr(ret_conv, true);
30323 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30324 LDKOutPoint this_obj_conv;
30325 this_obj_conv.inner = untag_ptr(this_obj);
30326 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30327 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30328 OutPoint_free(this_obj_conv);
30331 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(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 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
30338 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OutPoint_get_txid(&this_ptr_conv));
30342 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
30343 LDKOutPoint this_ptr_conv;
30344 this_ptr_conv.inner = untag_ptr(this_ptr);
30345 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30346 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30347 this_ptr_conv.is_owned = false;
30348 LDKThirtyTwoBytes val_ref;
30349 CHECK((*env)->GetArrayLength(env, val) == 32);
30350 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
30351 OutPoint_set_txid(&this_ptr_conv, val_ref);
30354 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv *env, jclass clz, int64_t this_ptr) {
30355 LDKOutPoint this_ptr_conv;
30356 this_ptr_conv.inner = untag_ptr(this_ptr);
30357 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30358 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30359 this_ptr_conv.is_owned = false;
30360 int16_t ret_conv = OutPoint_get_index(&this_ptr_conv);
30364 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
30365 LDKOutPoint this_ptr_conv;
30366 this_ptr_conv.inner = untag_ptr(this_ptr);
30367 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30368 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30369 this_ptr_conv.is_owned = false;
30370 OutPoint_set_index(&this_ptr_conv, val);
30373 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env, jclass clz, int8_tArray txid_arg, int16_t index_arg) {
30374 LDKThirtyTwoBytes txid_arg_ref;
30375 CHECK((*env)->GetArrayLength(env, txid_arg) == 32);
30376 (*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data);
30377 LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg);
30378 int64_t ret_ref = 0;
30379 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30380 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30384 static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) {
30385 LDKOutPoint ret_var = OutPoint_clone(arg);
30386 int64_t ret_ref = 0;
30387 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30388 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30391 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
30392 LDKOutPoint arg_conv;
30393 arg_conv.inner = untag_ptr(arg);
30394 arg_conv.is_owned = ptr_is_owned(arg);
30395 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30396 arg_conv.is_owned = false;
30397 int64_t ret_conv = OutPoint_clone_ptr(&arg_conv);
30401 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1clone(JNIEnv *env, jclass clz, int64_t orig) {
30402 LDKOutPoint orig_conv;
30403 orig_conv.inner = untag_ptr(orig);
30404 orig_conv.is_owned = ptr_is_owned(orig);
30405 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30406 orig_conv.is_owned = false;
30407 LDKOutPoint ret_var = OutPoint_clone(&orig_conv);
30408 int64_t ret_ref = 0;
30409 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30410 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30414 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OutPoint_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
30415 LDKOutPoint a_conv;
30416 a_conv.inner = untag_ptr(a);
30417 a_conv.is_owned = ptr_is_owned(a);
30418 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
30419 a_conv.is_owned = false;
30420 LDKOutPoint b_conv;
30421 b_conv.inner = untag_ptr(b);
30422 b_conv.is_owned = ptr_is_owned(b);
30423 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
30424 b_conv.is_owned = false;
30425 jboolean ret_conv = OutPoint_eq(&a_conv, &b_conv);
30429 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1hash(JNIEnv *env, jclass clz, int64_t o) {
30430 LDKOutPoint o_conv;
30431 o_conv.inner = untag_ptr(o);
30432 o_conv.is_owned = ptr_is_owned(o);
30433 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
30434 o_conv.is_owned = false;
30435 int64_t ret_conv = OutPoint_hash(&o_conv);
30439 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
30440 LDKOutPoint this_arg_conv;
30441 this_arg_conv.inner = untag_ptr(this_arg);
30442 this_arg_conv.is_owned = ptr_is_owned(this_arg);
30443 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
30444 this_arg_conv.is_owned = false;
30445 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
30446 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, OutPoint_to_channel_id(&this_arg_conv).data);
30450 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv *env, jclass clz, int64_t obj) {
30451 LDKOutPoint obj_conv;
30452 obj_conv.inner = untag_ptr(obj);
30453 obj_conv.is_owned = ptr_is_owned(obj);
30454 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
30455 obj_conv.is_owned = false;
30456 LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv);
30457 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
30458 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
30459 CVec_u8Z_free(ret_var);
30463 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
30464 LDKu8slice ser_ref;
30465 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
30466 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
30467 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
30468 *ret_conv = OutPoint_read(ser_ref);
30469 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
30470 return tag_ptr(ret_conv, true);
30473 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30474 LDKDelayedPaymentOutputDescriptor this_obj_conv;
30475 this_obj_conv.inner = untag_ptr(this_obj);
30476 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30477 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30478 DelayedPaymentOutputDescriptor_free(this_obj_conv);
30481 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
30482 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30483 this_ptr_conv.inner = untag_ptr(this_ptr);
30484 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30485 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30486 this_ptr_conv.is_owned = false;
30487 LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
30488 int64_t ret_ref = 0;
30489 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30490 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30494 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30495 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30496 this_ptr_conv.inner = untag_ptr(this_ptr);
30497 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30498 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30499 this_ptr_conv.is_owned = false;
30500 LDKOutPoint val_conv;
30501 val_conv.inner = untag_ptr(val);
30502 val_conv.is_owned = ptr_is_owned(val);
30503 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30504 val_conv = OutPoint_clone(&val_conv);
30505 DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
30508 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1per_1commitment_1point(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 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
30515 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form);
30519 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
30520 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30521 this_ptr_conv.inner = untag_ptr(this_ptr);
30522 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30523 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30524 this_ptr_conv.is_owned = false;
30525 LDKPublicKey val_ref;
30526 CHECK((*env)->GetArrayLength(env, val) == 33);
30527 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
30528 DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref);
30531 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
30532 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30533 this_ptr_conv.inner = untag_ptr(this_ptr);
30534 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30535 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30536 this_ptr_conv.is_owned = false;
30537 int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv);
30541 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
30542 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30543 this_ptr_conv.inner = untag_ptr(this_ptr);
30544 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30545 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30546 this_ptr_conv.is_owned = false;
30547 DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val);
30550 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) {
30551 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30552 this_ptr_conv.inner = untag_ptr(this_ptr);
30553 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30554 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30555 this_ptr_conv.is_owned = false;
30556 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
30557 *ret_ref = DelayedPaymentOutputDescriptor_get_output(&this_ptr_conv);
30558 return tag_ptr(ret_ref, true);
30561 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30562 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30563 this_ptr_conv.inner = untag_ptr(this_ptr);
30564 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30565 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30566 this_ptr_conv.is_owned = false;
30567 void* val_ptr = untag_ptr(val);
30568 CHECK_ACCESS(val_ptr);
30569 LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
30570 val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val));
30571 DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
30574 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1revocation_1pubkey(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, 33);
30581 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form);
30585 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1revocation_1pubkey(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 LDKPublicKey val_ref;
30592 CHECK((*env)->GetArrayLength(env, val) == 33);
30593 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
30594 DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_ref);
30597 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1keys_1id(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 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
30604 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv));
30608 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
30609 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30610 this_ptr_conv.inner = untag_ptr(this_ptr);
30611 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30612 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30613 this_ptr_conv.is_owned = false;
30614 LDKThirtyTwoBytes val_ref;
30615 CHECK((*env)->GetArrayLength(env, val) == 32);
30616 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
30617 DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
30620 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
30621 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30622 this_ptr_conv.inner = untag_ptr(this_ptr);
30623 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30624 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30625 this_ptr_conv.is_owned = false;
30626 int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
30630 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30631 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
30632 this_ptr_conv.inner = untag_ptr(this_ptr);
30633 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30634 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30635 this_ptr_conv.is_owned = false;
30636 DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
30639 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) {
30640 LDKOutPoint outpoint_arg_conv;
30641 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
30642 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
30643 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
30644 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
30645 LDKPublicKey per_commitment_point_arg_ref;
30646 CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33);
30647 (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form);
30648 void* output_arg_ptr = untag_ptr(output_arg);
30649 CHECK_ACCESS(output_arg_ptr);
30650 LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
30651 output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg));
30652 LDKPublicKey revocation_pubkey_arg_ref;
30653 CHECK((*env)->GetArrayLength(env, revocation_pubkey_arg) == 33);
30654 (*env)->GetByteArrayRegion(env, revocation_pubkey_arg, 0, 33, revocation_pubkey_arg_ref.compressed_form);
30655 LDKThirtyTwoBytes channel_keys_id_arg_ref;
30656 CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32);
30657 (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data);
30658 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);
30659 int64_t ret_ref = 0;
30660 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30661 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30665 static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) {
30666 LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg);
30667 int64_t ret_ref = 0;
30668 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30669 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30672 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
30673 LDKDelayedPaymentOutputDescriptor arg_conv;
30674 arg_conv.inner = untag_ptr(arg);
30675 arg_conv.is_owned = ptr_is_owned(arg);
30676 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30677 arg_conv.is_owned = false;
30678 int64_t ret_conv = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv);
30682 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
30683 LDKDelayedPaymentOutputDescriptor orig_conv;
30684 orig_conv.inner = untag_ptr(orig);
30685 orig_conv.is_owned = ptr_is_owned(orig);
30686 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30687 orig_conv.is_owned = false;
30688 LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv);
30689 int64_t ret_ref = 0;
30690 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30691 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30695 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
30696 LDKDelayedPaymentOutputDescriptor a_conv;
30697 a_conv.inner = untag_ptr(a);
30698 a_conv.is_owned = ptr_is_owned(a);
30699 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
30700 a_conv.is_owned = false;
30701 LDKDelayedPaymentOutputDescriptor b_conv;
30702 b_conv.inner = untag_ptr(b);
30703 b_conv.is_owned = ptr_is_owned(b);
30704 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
30705 b_conv.is_owned = false;
30706 jboolean ret_conv = DelayedPaymentOutputDescriptor_eq(&a_conv, &b_conv);
30710 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
30711 LDKDelayedPaymentOutputDescriptor obj_conv;
30712 obj_conv.inner = untag_ptr(obj);
30713 obj_conv.is_owned = ptr_is_owned(obj);
30714 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
30715 obj_conv.is_owned = false;
30716 LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv);
30717 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
30718 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
30719 CVec_u8Z_free(ret_var);
30723 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
30724 LDKu8slice ser_ref;
30725 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
30726 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
30727 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
30728 *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref);
30729 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
30730 return tag_ptr(ret_conv, true);
30733 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
30734 LDKStaticPaymentOutputDescriptor this_obj_conv;
30735 this_obj_conv.inner = untag_ptr(this_obj);
30736 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30737 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30738 StaticPaymentOutputDescriptor_free(this_obj_conv);
30741 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
30742 LDKStaticPaymentOutputDescriptor this_ptr_conv;
30743 this_ptr_conv.inner = untag_ptr(this_ptr);
30744 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30745 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30746 this_ptr_conv.is_owned = false;
30747 LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
30748 int64_t ret_ref = 0;
30749 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30750 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30754 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30755 LDKStaticPaymentOutputDescriptor this_ptr_conv;
30756 this_ptr_conv.inner = untag_ptr(this_ptr);
30757 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30758 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30759 this_ptr_conv.is_owned = false;
30760 LDKOutPoint val_conv;
30761 val_conv.inner = untag_ptr(val);
30762 val_conv.is_owned = ptr_is_owned(val);
30763 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30764 val_conv = OutPoint_clone(&val_conv);
30765 StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
30768 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1output(JNIEnv *env, jclass clz, int64_t this_ptr) {
30769 LDKStaticPaymentOutputDescriptor this_ptr_conv;
30770 this_ptr_conv.inner = untag_ptr(this_ptr);
30771 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30772 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30773 this_ptr_conv.is_owned = false;
30774 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
30775 *ret_ref = StaticPaymentOutputDescriptor_get_output(&this_ptr_conv);
30776 return tag_ptr(ret_ref, true);
30779 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1output(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30780 LDKStaticPaymentOutputDescriptor this_ptr_conv;
30781 this_ptr_conv.inner = untag_ptr(this_ptr);
30782 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30783 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30784 this_ptr_conv.is_owned = false;
30785 void* val_ptr = untag_ptr(val);
30786 CHECK_ACCESS(val_ptr);
30787 LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
30788 val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val));
30789 StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
30792 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1keys_1id(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 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
30799 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv));
30803 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
30804 LDKStaticPaymentOutputDescriptor this_ptr_conv;
30805 this_ptr_conv.inner = untag_ptr(this_ptr);
30806 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30807 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30808 this_ptr_conv.is_owned = false;
30809 LDKThirtyTwoBytes val_ref;
30810 CHECK((*env)->GetArrayLength(env, val) == 32);
30811 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
30812 StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
30815 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1get_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
30816 LDKStaticPaymentOutputDescriptor this_ptr_conv;
30817 this_ptr_conv.inner = untag_ptr(this_ptr);
30818 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30819 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30820 this_ptr_conv.is_owned = false;
30821 int64_t ret_conv = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
30825 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
30826 LDKStaticPaymentOutputDescriptor this_ptr_conv;
30827 this_ptr_conv.inner = untag_ptr(this_ptr);
30828 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30829 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30830 this_ptr_conv.is_owned = false;
30831 StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
30834 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) {
30835 LDKOutPoint outpoint_arg_conv;
30836 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
30837 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
30838 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
30839 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
30840 void* output_arg_ptr = untag_ptr(output_arg);
30841 CHECK_ACCESS(output_arg_ptr);
30842 LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
30843 output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg));
30844 LDKThirtyTwoBytes channel_keys_id_arg_ref;
30845 CHECK((*env)->GetArrayLength(env, channel_keys_id_arg) == 32);
30846 (*env)->GetByteArrayRegion(env, channel_keys_id_arg, 0, 32, channel_keys_id_arg_ref.data);
30847 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg);
30848 int64_t ret_ref = 0;
30849 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30850 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30854 static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) {
30855 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg);
30856 int64_t ret_ref = 0;
30857 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30858 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30861 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
30862 LDKStaticPaymentOutputDescriptor arg_conv;
30863 arg_conv.inner = untag_ptr(arg);
30864 arg_conv.is_owned = ptr_is_owned(arg);
30865 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30866 arg_conv.is_owned = false;
30867 int64_t ret_conv = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv);
30871 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
30872 LDKStaticPaymentOutputDescriptor orig_conv;
30873 orig_conv.inner = untag_ptr(orig);
30874 orig_conv.is_owned = ptr_is_owned(orig);
30875 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30876 orig_conv.is_owned = false;
30877 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv);
30878 int64_t ret_ref = 0;
30879 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30880 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30884 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
30885 LDKStaticPaymentOutputDescriptor a_conv;
30886 a_conv.inner = untag_ptr(a);
30887 a_conv.is_owned = ptr_is_owned(a);
30888 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
30889 a_conv.is_owned = false;
30890 LDKStaticPaymentOutputDescriptor b_conv;
30891 b_conv.inner = untag_ptr(b);
30892 b_conv.is_owned = ptr_is_owned(b);
30893 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
30894 b_conv.is_owned = false;
30895 jboolean ret_conv = StaticPaymentOutputDescriptor_eq(&a_conv, &b_conv);
30899 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
30900 LDKStaticPaymentOutputDescriptor obj_conv;
30901 obj_conv.inner = untag_ptr(obj);
30902 obj_conv.is_owned = ptr_is_owned(obj);
30903 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
30904 obj_conv.is_owned = false;
30905 LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv);
30906 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
30907 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
30908 CVec_u8Z_free(ret_var);
30912 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
30913 LDKu8slice ser_ref;
30914 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
30915 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
30916 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
30917 *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref);
30918 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
30919 return tag_ptr(ret_conv, true);
30922 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
30923 if (!ptr_is_owned(this_ptr)) return;
30924 void* this_ptr_ptr = untag_ptr(this_ptr);
30925 CHECK_ACCESS(this_ptr_ptr);
30926 LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr);
30927 FREE(untag_ptr(this_ptr));
30928 SpendableOutputDescriptor_free(this_ptr_conv);
30931 static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) {
30932 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
30933 *ret_copy = SpendableOutputDescriptor_clone(arg);
30934 int64_t ret_ref = tag_ptr(ret_copy, true);
30937 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
30938 LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(arg);
30939 int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv);
30943 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
30944 LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)untag_ptr(orig);
30945 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
30946 *ret_copy = SpendableOutputDescriptor_clone(orig_conv);
30947 int64_t ret_ref = tag_ptr(ret_copy, true);
30951 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1output(JNIEnv *env, jclass clz, int64_t outpoint, int64_t output) {
30952 LDKOutPoint outpoint_conv;
30953 outpoint_conv.inner = untag_ptr(outpoint);
30954 outpoint_conv.is_owned = ptr_is_owned(outpoint);
30955 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv);
30956 outpoint_conv = OutPoint_clone(&outpoint_conv);
30957 void* output_ptr = untag_ptr(output);
30958 CHECK_ACCESS(output_ptr);
30959 LDKTxOut output_conv = *(LDKTxOut*)(output_ptr);
30960 output_conv = TxOut_clone((LDKTxOut*)untag_ptr(output));
30961 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
30962 *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv);
30963 int64_t ret_ref = tag_ptr(ret_copy, true);
30967 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1delayed_1payment_1output(JNIEnv *env, jclass clz, int64_t a) {
30968 LDKDelayedPaymentOutputDescriptor a_conv;
30969 a_conv.inner = untag_ptr(a);
30970 a_conv.is_owned = ptr_is_owned(a);
30971 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
30972 a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv);
30973 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
30974 *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv);
30975 int64_t ret_ref = tag_ptr(ret_copy, true);
30979 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1payment_1output(JNIEnv *env, jclass clz, int64_t a) {
30980 LDKStaticPaymentOutputDescriptor a_conv;
30981 a_conv.inner = untag_ptr(a);
30982 a_conv.is_owned = ptr_is_owned(a);
30983 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
30984 a_conv = StaticPaymentOutputDescriptor_clone(&a_conv);
30985 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
30986 *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv);
30987 int64_t ret_ref = tag_ptr(ret_copy, true);
30991 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
30992 LDKSpendableOutputDescriptor* a_conv = (LDKSpendableOutputDescriptor*)untag_ptr(a);
30993 LDKSpendableOutputDescriptor* b_conv = (LDKSpendableOutputDescriptor*)untag_ptr(b);
30994 jboolean ret_conv = SpendableOutputDescriptor_eq(a_conv, b_conv);
30998 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
30999 LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj);
31000 LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv);
31001 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
31002 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
31003 CVec_u8Z_free(ret_var);
31007 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
31008 LDKu8slice ser_ref;
31009 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
31010 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
31011 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
31012 *ret_conv = SpendableOutputDescriptor_read(ser_ref);
31013 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
31014 return tag_ptr(ret_conv, true);
31017 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
31018 if (!ptr_is_owned(this_ptr)) return;
31019 void* this_ptr_ptr = untag_ptr(this_ptr);
31020 CHECK_ACCESS(this_ptr_ptr);
31021 LDKChannelSigner this_ptr_conv = *(LDKChannelSigner*)(this_ptr_ptr);
31022 FREE(untag_ptr(this_ptr));
31023 ChannelSigner_free(this_ptr_conv);
31026 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EcdsaChannelSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
31027 if (!ptr_is_owned(this_ptr)) return;
31028 void* this_ptr_ptr = untag_ptr(this_ptr);
31029 CHECK_ACCESS(this_ptr_ptr);
31030 LDKEcdsaChannelSigner this_ptr_conv = *(LDKEcdsaChannelSigner*)(this_ptr_ptr);
31031 FREE(untag_ptr(this_ptr));
31032 EcdsaChannelSigner_free(this_ptr_conv);
31035 static inline uint64_t WriteableEcdsaChannelSigner_clone_ptr(LDKWriteableEcdsaChannelSigner *NONNULL_PTR arg) {
31036 LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner");
31037 *ret_ret = WriteableEcdsaChannelSigner_clone(arg);
31038 return tag_ptr(ret_ret, true);
31040 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
31041 void* arg_ptr = untag_ptr(arg);
31042 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
31043 LDKWriteableEcdsaChannelSigner* arg_conv = (LDKWriteableEcdsaChannelSigner*)arg_ptr;
31044 int64_t ret_conv = WriteableEcdsaChannelSigner_clone_ptr(arg_conv);
31048 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1clone(JNIEnv *env, jclass clz, int64_t orig) {
31049 void* orig_ptr = untag_ptr(orig);
31050 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
31051 LDKWriteableEcdsaChannelSigner* orig_conv = (LDKWriteableEcdsaChannelSigner*)orig_ptr;
31052 LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner");
31053 *ret_ret = WriteableEcdsaChannelSigner_clone(orig_conv);
31054 return tag_ptr(ret_ret, true);
31057 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WriteableEcdsaChannelSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
31058 if (!ptr_is_owned(this_ptr)) return;
31059 void* this_ptr_ptr = untag_ptr(this_ptr);
31060 CHECK_ACCESS(this_ptr_ptr);
31061 LDKWriteableEcdsaChannelSigner this_ptr_conv = *(LDKWriteableEcdsaChannelSigner*)(this_ptr_ptr);
31062 FREE(untag_ptr(this_ptr));
31063 WriteableEcdsaChannelSigner_free(this_ptr_conv);
31066 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1clone(JNIEnv *env, jclass clz, int64_t orig) {
31067 LDKRecipient* orig_conv = (LDKRecipient*)untag_ptr(orig);
31068 jclass ret_conv = LDKRecipient_to_java(env, Recipient_clone(orig_conv));
31072 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1node(JNIEnv *env, jclass clz) {
31073 jclass ret_conv = LDKRecipient_to_java(env, Recipient_node());
31077 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Recipient_1phantom_1node(JNIEnv *env, jclass clz) {
31078 jclass ret_conv = LDKRecipient_to_java(env, Recipient_phantom_node());
31082 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EntropySource_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
31083 if (!ptr_is_owned(this_ptr)) return;
31084 void* this_ptr_ptr = untag_ptr(this_ptr);
31085 CHECK_ACCESS(this_ptr_ptr);
31086 LDKEntropySource this_ptr_conv = *(LDKEntropySource*)(this_ptr_ptr);
31087 FREE(untag_ptr(this_ptr));
31088 EntropySource_free(this_ptr_conv);
31091 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeSigner_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
31092 if (!ptr_is_owned(this_ptr)) return;
31093 void* this_ptr_ptr = untag_ptr(this_ptr);
31094 CHECK_ACCESS(this_ptr_ptr);
31095 LDKNodeSigner this_ptr_conv = *(LDKNodeSigner*)(this_ptr_ptr);
31096 FREE(untag_ptr(this_ptr));
31097 NodeSigner_free(this_ptr_conv);
31100 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignerProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
31101 if (!ptr_is_owned(this_ptr)) return;
31102 void* this_ptr_ptr = untag_ptr(this_ptr);
31103 CHECK_ACCESS(this_ptr_ptr);
31104 LDKSignerProvider this_ptr_conv = *(LDKSignerProvider*)(this_ptr_ptr);
31105 FREE(untag_ptr(this_ptr));
31106 SignerProvider_free(this_ptr_conv);
31109 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
31110 LDKInMemorySigner this_obj_conv;
31111 this_obj_conv.inner = untag_ptr(this_obj);
31112 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31113 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31114 InMemorySigner_free(this_obj_conv);
31117 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1funding_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_funding_key(&this_ptr_conv));
31128 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1funding_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_funding_key(&this_ptr_conv, val_ref);
31140 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1revocation_1base_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_revocation_base_key(&this_ptr_conv));
31151 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1revocation_1base_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_revocation_base_key(&this_ptr_conv, val_ref);
31163 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1payment_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_payment_key(&this_ptr_conv));
31174 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1payment_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_payment_key(&this_ptr_conv, val_ref);
31186 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1delayed_1payment_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_delayed_payment_base_key(&this_ptr_conv));
31197 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) {
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_delayed_payment_base_key(&this_ptr_conv, val_ref);
31209 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1htlc_1base_1key(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_htlc_base_key(&this_ptr_conv));
31220 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1htlc_1base_1key(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 LDKSecretKey val_ref;
31227 CHECK((*env)->GetArrayLength(env, val) == 32);
31228 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.bytes);
31229 InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref);
31232 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr) {
31233 LDKInMemorySigner this_ptr_conv;
31234 this_ptr_conv.inner = untag_ptr(this_ptr);
31235 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31236 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31237 this_ptr_conv.is_owned = false;
31238 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
31239 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *InMemorySigner_get_commitment_seed(&this_ptr_conv));
31243 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1set_1commitment_1seed(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
31244 LDKInMemorySigner this_ptr_conv;
31245 this_ptr_conv.inner = untag_ptr(this_ptr);
31246 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31247 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31248 this_ptr_conv.is_owned = false;
31249 LDKThirtyTwoBytes val_ref;
31250 CHECK((*env)->GetArrayLength(env, val) == 32);
31251 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
31252 InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref);
31255 static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) {
31256 LDKInMemorySigner ret_var = InMemorySigner_clone(arg);
31257 int64_t ret_ref = 0;
31258 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31259 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31262 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
31263 LDKInMemorySigner arg_conv;
31264 arg_conv.inner = untag_ptr(arg);
31265 arg_conv.is_owned = ptr_is_owned(arg);
31266 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31267 arg_conv.is_owned = false;
31268 int64_t ret_conv = InMemorySigner_clone_ptr(&arg_conv);
31272 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1clone(JNIEnv *env, jclass clz, int64_t orig) {
31273 LDKInMemorySigner orig_conv;
31274 orig_conv.inner = untag_ptr(orig);
31275 orig_conv.is_owned = ptr_is_owned(orig);
31276 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31277 orig_conv.is_owned = false;
31278 LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv);
31279 int64_t ret_ref = 0;
31280 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31281 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31285 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, int8_tArray rand_bytes_unique_start) {
31286 LDKSecretKey funding_key_ref;
31287 CHECK((*env)->GetArrayLength(env, funding_key) == 32);
31288 (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_ref.bytes);
31289 LDKSecretKey revocation_base_key_ref;
31290 CHECK((*env)->GetArrayLength(env, revocation_base_key) == 32);
31291 (*env)->GetByteArrayRegion(env, revocation_base_key, 0, 32, revocation_base_key_ref.bytes);
31292 LDKSecretKey payment_key_ref;
31293 CHECK((*env)->GetArrayLength(env, payment_key) == 32);
31294 (*env)->GetByteArrayRegion(env, payment_key, 0, 32, payment_key_ref.bytes);
31295 LDKSecretKey delayed_payment_base_key_ref;
31296 CHECK((*env)->GetArrayLength(env, delayed_payment_base_key) == 32);
31297 (*env)->GetByteArrayRegion(env, delayed_payment_base_key, 0, 32, delayed_payment_base_key_ref.bytes);
31298 LDKSecretKey htlc_base_key_ref;
31299 CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32);
31300 (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_ref.bytes);
31301 LDKThirtyTwoBytes commitment_seed_ref;
31302 CHECK((*env)->GetArrayLength(env, commitment_seed) == 32);
31303 (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_ref.data);
31304 LDKThirtyTwoBytes channel_keys_id_ref;
31305 CHECK((*env)->GetArrayLength(env, channel_keys_id) == 32);
31306 (*env)->GetByteArrayRegion(env, channel_keys_id, 0, 32, channel_keys_id_ref.data);
31307 LDKThirtyTwoBytes rand_bytes_unique_start_ref;
31308 CHECK((*env)->GetArrayLength(env, rand_bytes_unique_start) == 32);
31309 (*env)->GetByteArrayRegion(env, rand_bytes_unique_start, 0, 32, rand_bytes_unique_start_ref.data);
31310 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, rand_bytes_unique_start_ref);
31311 int64_t ret_ref = 0;
31312 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31313 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31317 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
31318 LDKInMemorySigner this_arg_conv;
31319 this_arg_conv.inner = untag_ptr(this_arg);
31320 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31321 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31322 this_arg_conv.is_owned = false;
31323 LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv);
31324 int64_t ret_ref = 0;
31325 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31326 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31330 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1counterparty_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) {
31331 LDKInMemorySigner this_arg_conv;
31332 this_arg_conv.inner = untag_ptr(this_arg);
31333 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31334 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31335 this_arg_conv.is_owned = false;
31336 int16_t ret_conv = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv);
31340 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) {
31341 LDKInMemorySigner this_arg_conv;
31342 this_arg_conv.inner = untag_ptr(this_arg);
31343 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31344 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31345 this_arg_conv.is_owned = false;
31346 int16_t ret_conv = InMemorySigner_holder_selected_contest_delay(&this_arg_conv);
31350 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) {
31351 LDKInMemorySigner this_arg_conv;
31352 this_arg_conv.inner = untag_ptr(this_arg);
31353 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31354 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31355 this_arg_conv.is_owned = false;
31356 jboolean ret_conv = InMemorySigner_is_outbound(&this_arg_conv);
31360 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1funding_1outpoint(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 LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv);
31367 int64_t ret_ref = 0;
31368 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31369 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31373 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1get_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg) {
31374 LDKInMemorySigner this_arg_conv;
31375 this_arg_conv.inner = untag_ptr(this_arg);
31376 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31377 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31378 this_arg_conv.is_owned = false;
31379 LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv);
31380 int64_t ret_ref = 0;
31381 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31382 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31386 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) {
31387 LDKInMemorySigner this_arg_conv;
31388 this_arg_conv.inner = untag_ptr(this_arg);
31389 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31390 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31391 this_arg_conv.is_owned = false;
31392 jboolean ret_conv = InMemorySigner_opt_anchors(&this_arg_conv);
31396 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) {
31397 LDKInMemorySigner this_arg_conv;
31398 this_arg_conv.inner = untag_ptr(this_arg);
31399 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31400 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31401 this_arg_conv.is_owned = false;
31402 LDKTransaction spend_tx_ref;
31403 spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx);
31404 spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
31405 (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data);
31406 spend_tx_ref.data_is_owned = true;
31407 LDKStaticPaymentOutputDescriptor descriptor_conv;
31408 descriptor_conv.inner = untag_ptr(descriptor);
31409 descriptor_conv.is_owned = ptr_is_owned(descriptor);
31410 CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
31411 descriptor_conv.is_owned = false;
31412 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
31413 *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
31414 return tag_ptr(ret_conv, true);
31417 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) {
31418 LDKInMemorySigner this_arg_conv;
31419 this_arg_conv.inner = untag_ptr(this_arg);
31420 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31421 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31422 this_arg_conv.is_owned = false;
31423 LDKTransaction spend_tx_ref;
31424 spend_tx_ref.datalen = (*env)->GetArrayLength(env, spend_tx);
31425 spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
31426 (*env)->GetByteArrayRegion(env, spend_tx, 0, spend_tx_ref.datalen, spend_tx_ref.data);
31427 spend_tx_ref.data_is_owned = true;
31428 LDKDelayedPaymentOutputDescriptor descriptor_conv;
31429 descriptor_conv.inner = untag_ptr(descriptor);
31430 descriptor_conv.is_owned = ptr_is_owned(descriptor);
31431 CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
31432 descriptor_conv.is_owned = false;
31433 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
31434 *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
31435 return tag_ptr(ret_conv, true);
31438 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) {
31439 LDKInMemorySigner this_arg_conv;
31440 this_arg_conv.inner = untag_ptr(this_arg);
31441 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31442 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31443 this_arg_conv.is_owned = false;
31444 LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource");
31445 *ret_ret = InMemorySigner_as_EntropySource(&this_arg_conv);
31446 return tag_ptr(ret_ret, true);
31449 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1ChannelSigner(JNIEnv *env, jclass clz, int64_t this_arg) {
31450 LDKInMemorySigner this_arg_conv;
31451 this_arg_conv.inner = untag_ptr(this_arg);
31452 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31453 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31454 this_arg_conv.is_owned = false;
31455 LDKChannelSigner* ret_ret = MALLOC(sizeof(LDKChannelSigner), "LDKChannelSigner");
31456 *ret_ret = InMemorySigner_as_ChannelSigner(&this_arg_conv);
31457 return tag_ptr(ret_ret, true);
31460 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1EcdsaChannelSigner(JNIEnv *env, jclass clz, int64_t this_arg) {
31461 LDKInMemorySigner this_arg_conv;
31462 this_arg_conv.inner = untag_ptr(this_arg);
31463 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31464 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31465 this_arg_conv.is_owned = false;
31466 LDKEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKEcdsaChannelSigner), "LDKEcdsaChannelSigner");
31467 *ret_ret = InMemorySigner_as_EcdsaChannelSigner(&this_arg_conv);
31468 return tag_ptr(ret_ret, true);
31471 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1as_1WriteableEcdsaChannelSigner(JNIEnv *env, jclass clz, int64_t this_arg) {
31472 LDKInMemorySigner this_arg_conv;
31473 this_arg_conv.inner = untag_ptr(this_arg);
31474 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31475 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31476 this_arg_conv.is_owned = false;
31477 LDKWriteableEcdsaChannelSigner* ret_ret = MALLOC(sizeof(LDKWriteableEcdsaChannelSigner), "LDKWriteableEcdsaChannelSigner");
31478 *ret_ret = InMemorySigner_as_WriteableEcdsaChannelSigner(&this_arg_conv);
31479 return tag_ptr(ret_ret, true);
31482 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1write(JNIEnv *env, jclass clz, int64_t obj) {
31483 LDKInMemorySigner obj_conv;
31484 obj_conv.inner = untag_ptr(obj);
31485 obj_conv.is_owned = ptr_is_owned(obj);
31486 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
31487 obj_conv.is_owned = false;
31488 LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv);
31489 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
31490 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
31491 CVec_u8Z_free(ret_var);
31495 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemorySigner_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) {
31496 LDKu8slice ser_ref;
31497 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
31498 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
31499 void* arg_ptr = untag_ptr(arg);
31500 CHECK_ACCESS(arg_ptr);
31501 LDKEntropySource arg_conv = *(LDKEntropySource*)(arg_ptr);
31502 if (arg_conv.free == LDKEntropySource_JCalls_free) {
31503 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
31504 LDKEntropySource_JCalls_cloned(&arg_conv);
31506 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
31507 *ret_conv = InMemorySigner_read(ser_ref, arg_conv);
31508 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
31509 return tag_ptr(ret_conv, true);
31512 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
31513 LDKKeysManager this_obj_conv;
31514 this_obj_conv.inner = untag_ptr(this_obj);
31515 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31516 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31517 KeysManager_free(this_obj_conv);
31520 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) {
31521 uint8_t seed_arr[32];
31522 CHECK((*env)->GetArrayLength(env, seed) == 32);
31523 (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr);
31524 uint8_t (*seed_ref)[32] = &seed_arr;
31525 LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos);
31526 int64_t ret_ref = 0;
31527 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31528 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31532 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysManager_1get_1node_1secret_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
31533 LDKKeysManager this_arg_conv;
31534 this_arg_conv.inner = untag_ptr(this_arg);
31535 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31536 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31537 this_arg_conv.is_owned = false;
31538 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
31539 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, KeysManager_get_node_secret_key(&this_arg_conv).bytes);
31543 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) {
31544 LDKKeysManager this_arg_conv;
31545 this_arg_conv.inner = untag_ptr(this_arg);
31546 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31547 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31548 this_arg_conv.is_owned = false;
31549 uint8_t params_arr[32];
31550 CHECK((*env)->GetArrayLength(env, params) == 32);
31551 (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr);
31552 uint8_t (*params_ref)[32] = ¶ms_arr;
31553 LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
31554 int64_t ret_ref = 0;
31555 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31556 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31560 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) {
31561 LDKKeysManager this_arg_conv;
31562 this_arg_conv.inner = untag_ptr(this_arg);
31563 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31564 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31565 this_arg_conv.is_owned = false;
31566 LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
31567 descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors);
31568 if (descriptors_constr.datalen > 0)
31569 descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
31571 descriptors_constr.data = NULL;
31572 int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL);
31573 for (size_t b = 0; b < descriptors_constr.datalen; b++) {
31574 int64_t descriptors_conv_27 = descriptors_vals[b];
31575 void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27);
31576 CHECK_ACCESS(descriptors_conv_27_ptr);
31577 LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
31578 descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27));
31579 descriptors_constr.data[b] = descriptors_conv_27_conv;
31581 (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0);
31582 LDKCVec_TxOutZ outputs_constr;
31583 outputs_constr.datalen = (*env)->GetArrayLength(env, outputs);
31584 if (outputs_constr.datalen > 0)
31585 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
31587 outputs_constr.data = NULL;
31588 int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL);
31589 for (size_t h = 0; h < outputs_constr.datalen; h++) {
31590 int64_t outputs_conv_7 = outputs_vals[h];
31591 void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7);
31592 CHECK_ACCESS(outputs_conv_7_ptr);
31593 LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
31594 outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7));
31595 outputs_constr.data[h] = outputs_conv_7_conv;
31597 (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0);
31598 LDKCVec_u8Z change_destination_script_ref;
31599 change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script);
31600 change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
31601 (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data);
31602 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
31603 *ret_conv = KeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
31604 return tag_ptr(ret_conv, true);
31607 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) {
31608 LDKKeysManager this_arg_conv;
31609 this_arg_conv.inner = untag_ptr(this_arg);
31610 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31611 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31612 this_arg_conv.is_owned = false;
31613 LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource");
31614 *ret_ret = KeysManager_as_EntropySource(&this_arg_conv);
31615 return tag_ptr(ret_ret, true);
31618 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1NodeSigner(JNIEnv *env, jclass clz, int64_t this_arg) {
31619 LDKKeysManager this_arg_conv;
31620 this_arg_conv.inner = untag_ptr(this_arg);
31621 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31622 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31623 this_arg_conv.is_owned = false;
31624 LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner");
31625 *ret_ret = KeysManager_as_NodeSigner(&this_arg_conv);
31626 return tag_ptr(ret_ret, true);
31629 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1SignerProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
31630 LDKKeysManager this_arg_conv;
31631 this_arg_conv.inner = untag_ptr(this_arg);
31632 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31633 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31634 this_arg_conv.is_owned = false;
31635 LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider");
31636 *ret_ret = KeysManager_as_SignerProvider(&this_arg_conv);
31637 return tag_ptr(ret_ret, true);
31640 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
31641 LDKPhantomKeysManager this_obj_conv;
31642 this_obj_conv.inner = untag_ptr(this_obj);
31643 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31644 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31645 PhantomKeysManager_free(this_obj_conv);
31648 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1EntropySource(JNIEnv *env, jclass clz, int64_t this_arg) {
31649 LDKPhantomKeysManager this_arg_conv;
31650 this_arg_conv.inner = untag_ptr(this_arg);
31651 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31652 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31653 this_arg_conv.is_owned = false;
31654 LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource");
31655 *ret_ret = PhantomKeysManager_as_EntropySource(&this_arg_conv);
31656 return tag_ptr(ret_ret, true);
31659 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1NodeSigner(JNIEnv *env, jclass clz, int64_t this_arg) {
31660 LDKPhantomKeysManager this_arg_conv;
31661 this_arg_conv.inner = untag_ptr(this_arg);
31662 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31663 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31664 this_arg_conv.is_owned = false;
31665 LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner");
31666 *ret_ret = PhantomKeysManager_as_NodeSigner(&this_arg_conv);
31667 return tag_ptr(ret_ret, true);
31670 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1as_1SignerProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
31671 LDKPhantomKeysManager this_arg_conv;
31672 this_arg_conv.inner = untag_ptr(this_arg);
31673 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31674 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31675 this_arg_conv.is_owned = false;
31676 LDKSignerProvider* ret_ret = MALLOC(sizeof(LDKSignerProvider), "LDKSignerProvider");
31677 *ret_ret = PhantomKeysManager_as_SignerProvider(&this_arg_conv);
31678 return tag_ptr(ret_ret, true);
31681 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) {
31682 uint8_t seed_arr[32];
31683 CHECK((*env)->GetArrayLength(env, seed) == 32);
31684 (*env)->GetByteArrayRegion(env, seed, 0, 32, seed_arr);
31685 uint8_t (*seed_ref)[32] = &seed_arr;
31686 uint8_t cross_node_seed_arr[32];
31687 CHECK((*env)->GetArrayLength(env, cross_node_seed) == 32);
31688 (*env)->GetByteArrayRegion(env, cross_node_seed, 0, 32, cross_node_seed_arr);
31689 uint8_t (*cross_node_seed_ref)[32] = &cross_node_seed_arr;
31690 LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref);
31691 int64_t ret_ref = 0;
31692 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31693 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31697 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) {
31698 LDKPhantomKeysManager this_arg_conv;
31699 this_arg_conv.inner = untag_ptr(this_arg);
31700 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31701 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31702 this_arg_conv.is_owned = false;
31703 LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
31704 descriptors_constr.datalen = (*env)->GetArrayLength(env, descriptors);
31705 if (descriptors_constr.datalen > 0)
31706 descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
31708 descriptors_constr.data = NULL;
31709 int64_t* descriptors_vals = (*env)->GetLongArrayElements (env, descriptors, NULL);
31710 for (size_t b = 0; b < descriptors_constr.datalen; b++) {
31711 int64_t descriptors_conv_27 = descriptors_vals[b];
31712 void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27);
31713 CHECK_ACCESS(descriptors_conv_27_ptr);
31714 LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
31715 descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27));
31716 descriptors_constr.data[b] = descriptors_conv_27_conv;
31718 (*env)->ReleaseLongArrayElements(env, descriptors, descriptors_vals, 0);
31719 LDKCVec_TxOutZ outputs_constr;
31720 outputs_constr.datalen = (*env)->GetArrayLength(env, outputs);
31721 if (outputs_constr.datalen > 0)
31722 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
31724 outputs_constr.data = NULL;
31725 int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL);
31726 for (size_t h = 0; h < outputs_constr.datalen; h++) {
31727 int64_t outputs_conv_7 = outputs_vals[h];
31728 void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7);
31729 CHECK_ACCESS(outputs_conv_7_ptr);
31730 LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
31731 outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7));
31732 outputs_constr.data[h] = outputs_conv_7_conv;
31734 (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0);
31735 LDKCVec_u8Z change_destination_script_ref;
31736 change_destination_script_ref.datalen = (*env)->GetArrayLength(env, change_destination_script);
31737 change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
31738 (*env)->GetByteArrayRegion(env, change_destination_script, 0, change_destination_script_ref.datalen, change_destination_script_ref.data);
31739 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
31740 *ret_conv = PhantomKeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
31741 return tag_ptr(ret_conv, true);
31744 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) {
31745 LDKPhantomKeysManager this_arg_conv;
31746 this_arg_conv.inner = untag_ptr(this_arg);
31747 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31748 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31749 this_arg_conv.is_owned = false;
31750 uint8_t params_arr[32];
31751 CHECK((*env)->GetArrayLength(env, params) == 32);
31752 (*env)->GetByteArrayRegion(env, params, 0, 32, params_arr);
31753 uint8_t (*params_ref)[32] = ¶ms_arr;
31754 LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
31755 int64_t ret_ref = 0;
31756 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31757 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31761 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1get_1node_1secret_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
31762 LDKPhantomKeysManager this_arg_conv;
31763 this_arg_conv.inner = untag_ptr(this_arg);
31764 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31765 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31766 this_arg_conv.is_owned = false;
31767 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
31768 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, PhantomKeysManager_get_node_secret_key(&this_arg_conv).bytes);
31772 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomKeysManager_1get_1phantom_1node_1secret_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
31773 LDKPhantomKeysManager this_arg_conv;
31774 this_arg_conv.inner = untag_ptr(this_arg);
31775 this_arg_conv.is_owned = ptr_is_owned(this_arg);
31776 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
31777 this_arg_conv.is_owned = false;
31778 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
31779 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, PhantomKeysManager_get_phantom_node_secret_key(&this_arg_conv).bytes);
31783 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_FailureCode_1clone(JNIEnv *env, jclass clz, int64_t orig) {
31784 LDKFailureCode* orig_conv = (LDKFailureCode*)untag_ptr(orig);
31785 jclass ret_conv = LDKFailureCode_to_java(env, FailureCode_clone(orig_conv));
31789 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_FailureCode_1temporary_1node_1failure(JNIEnv *env, jclass clz) {
31790 jclass ret_conv = LDKFailureCode_to_java(env, FailureCode_temporary_node_failure());
31794 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_FailureCode_1required_1node_1feature_1missing(JNIEnv *env, jclass clz) {
31795 jclass ret_conv = LDKFailureCode_to_java(env, FailureCode_required_node_feature_missing());
31799 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_FailureCode_1incorrect_1or_1unknown_1payment_1details(JNIEnv *env, jclass clz) {
31800 jclass ret_conv = LDKFailureCode_to_java(env, FailureCode_incorrect_or_unknown_payment_details());
31804 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
31805 LDKChannelManager this_obj_conv;
31806 this_obj_conv.inner = untag_ptr(this_obj);
31807 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31808 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31809 ChannelManager_free(this_obj_conv);
31812 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
31813 LDKChainParameters this_obj_conv;
31814 this_obj_conv.inner = untag_ptr(this_obj);
31815 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31816 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31817 ChainParameters_free(this_obj_conv);
31820 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1network(JNIEnv *env, jclass clz, int64_t this_ptr) {
31821 LDKChainParameters this_ptr_conv;
31822 this_ptr_conv.inner = untag_ptr(this_ptr);
31823 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31824 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31825 this_ptr_conv.is_owned = false;
31826 jclass ret_conv = LDKNetwork_to_java(env, ChainParameters_get_network(&this_ptr_conv));
31830 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1network(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) {
31831 LDKChainParameters this_ptr_conv;
31832 this_ptr_conv.inner = untag_ptr(this_ptr);
31833 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31834 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31835 this_ptr_conv.is_owned = false;
31836 LDKNetwork val_conv = LDKNetwork_from_java(env, val);
31837 ChainParameters_set_network(&this_ptr_conv, val_conv);
31840 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1get_1best_1block(JNIEnv *env, jclass clz, int64_t this_ptr) {
31841 LDKChainParameters this_ptr_conv;
31842 this_ptr_conv.inner = untag_ptr(this_ptr);
31843 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31845 this_ptr_conv.is_owned = false;
31846 LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv);
31847 int64_t ret_ref = 0;
31848 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31849 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31853 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainParameters_1set_1best_1block(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
31854 LDKChainParameters this_ptr_conv;
31855 this_ptr_conv.inner = untag_ptr(this_ptr);
31856 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31857 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31858 this_ptr_conv.is_owned = false;
31859 LDKBestBlock val_conv;
31860 val_conv.inner = untag_ptr(val);
31861 val_conv.is_owned = ptr_is_owned(val);
31862 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
31863 val_conv = BestBlock_clone(&val_conv);
31864 ChainParameters_set_best_block(&this_ptr_conv, val_conv);
31867 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1new(JNIEnv *env, jclass clz, jclass network_arg, int64_t best_block_arg) {
31868 LDKNetwork network_arg_conv = LDKNetwork_from_java(env, network_arg);
31869 LDKBestBlock best_block_arg_conv;
31870 best_block_arg_conv.inner = untag_ptr(best_block_arg);
31871 best_block_arg_conv.is_owned = ptr_is_owned(best_block_arg);
31872 CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv);
31873 best_block_arg_conv = BestBlock_clone(&best_block_arg_conv);
31874 LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv);
31875 int64_t ret_ref = 0;
31876 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31877 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31881 static inline uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) {
31882 LDKChainParameters ret_var = ChainParameters_clone(arg);
31883 int64_t ret_ref = 0;
31884 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31885 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31888 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
31889 LDKChainParameters arg_conv;
31890 arg_conv.inner = untag_ptr(arg);
31891 arg_conv.is_owned = ptr_is_owned(arg);
31892 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31893 arg_conv.is_owned = false;
31894 int64_t ret_conv = ChainParameters_clone_ptr(&arg_conv);
31898 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
31899 LDKChainParameters orig_conv;
31900 orig_conv.inner = untag_ptr(orig);
31901 orig_conv.is_owned = ptr_is_owned(orig);
31902 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31903 orig_conv.is_owned = false;
31904 LDKChainParameters ret_var = ChainParameters_clone(&orig_conv);
31905 int64_t ret_ref = 0;
31906 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31907 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31911 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
31912 LDKCounterpartyForwardingInfo this_obj_conv;
31913 this_obj_conv.inner = untag_ptr(this_obj);
31914 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31915 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31916 CounterpartyForwardingInfo_free(this_obj_conv);
31919 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
31920 LDKCounterpartyForwardingInfo this_ptr_conv;
31921 this_ptr_conv.inner = untag_ptr(this_ptr);
31922 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31923 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31924 this_ptr_conv.is_owned = false;
31925 int32_t ret_conv = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv);
31929 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
31930 LDKCounterpartyForwardingInfo this_ptr_conv;
31931 this_ptr_conv.inner = untag_ptr(this_ptr);
31932 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31933 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31934 this_ptr_conv.is_owned = false;
31935 CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val);
31938 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
31939 LDKCounterpartyForwardingInfo this_ptr_conv;
31940 this_ptr_conv.inner = untag_ptr(this_ptr);
31941 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31942 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31943 this_ptr_conv.is_owned = false;
31944 int32_t ret_conv = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv);
31948 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
31949 LDKCounterpartyForwardingInfo this_ptr_conv;
31950 this_ptr_conv.inner = untag_ptr(this_ptr);
31951 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31952 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31953 this_ptr_conv.is_owned = false;
31954 CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val);
31957 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
31958 LDKCounterpartyForwardingInfo this_ptr_conv;
31959 this_ptr_conv.inner = untag_ptr(this_ptr);
31960 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31961 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31962 this_ptr_conv.is_owned = false;
31963 int16_t ret_conv = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv);
31967 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
31968 LDKCounterpartyForwardingInfo this_ptr_conv;
31969 this_ptr_conv.inner = untag_ptr(this_ptr);
31970 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31971 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31972 this_ptr_conv.is_owned = false;
31973 CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
31976 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) {
31977 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg);
31978 int64_t ret_ref = 0;
31979 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31980 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31984 static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) {
31985 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg);
31986 int64_t ret_ref = 0;
31987 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31988 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31991 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
31992 LDKCounterpartyForwardingInfo arg_conv;
31993 arg_conv.inner = untag_ptr(arg);
31994 arg_conv.is_owned = ptr_is_owned(arg);
31995 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31996 arg_conv.is_owned = false;
31997 int64_t ret_conv = CounterpartyForwardingInfo_clone_ptr(&arg_conv);
32001 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
32002 LDKCounterpartyForwardingInfo orig_conv;
32003 orig_conv.inner = untag_ptr(orig);
32004 orig_conv.is_owned = ptr_is_owned(orig);
32005 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32006 orig_conv.is_owned = false;
32007 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_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_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
32015 LDKChannelCounterparty this_obj_conv;
32016 this_obj_conv.inner = untag_ptr(this_obj);
32017 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32018 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32019 ChannelCounterparty_free(this_obj_conv);
32022 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32023 LDKChannelCounterparty this_ptr_conv;
32024 this_ptr_conv.inner = untag_ptr(this_ptr);
32025 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32026 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32027 this_ptr_conv.is_owned = false;
32028 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
32029 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form);
32033 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
32034 LDKChannelCounterparty this_ptr_conv;
32035 this_ptr_conv.inner = untag_ptr(this_ptr);
32036 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32037 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32038 this_ptr_conv.is_owned = false;
32039 LDKPublicKey val_ref;
32040 CHECK((*env)->GetArrayLength(env, val) == 33);
32041 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
32042 ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref);
32045 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
32046 LDKChannelCounterparty this_ptr_conv;
32047 this_ptr_conv.inner = untag_ptr(this_ptr);
32048 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32049 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32050 this_ptr_conv.is_owned = false;
32051 LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv);
32052 int64_t ret_ref = 0;
32053 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32054 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32058 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32059 LDKChannelCounterparty this_ptr_conv;
32060 this_ptr_conv.inner = untag_ptr(this_ptr);
32061 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32062 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32063 this_ptr_conv.is_owned = false;
32064 LDKInitFeatures val_conv;
32065 val_conv.inner = untag_ptr(val);
32066 val_conv.is_owned = ptr_is_owned(val);
32067 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32068 val_conv = InitFeatures_clone(&val_conv);
32069 ChannelCounterparty_set_features(&this_ptr_conv, val_conv);
32072 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr) {
32073 LDKChannelCounterparty this_ptr_conv;
32074 this_ptr_conv.inner = untag_ptr(this_ptr);
32075 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32076 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32077 this_ptr_conv.is_owned = false;
32078 int64_t ret_conv = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv);
32082 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32083 LDKChannelCounterparty this_ptr_conv;
32084 this_ptr_conv.inner = untag_ptr(this_ptr);
32085 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32086 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32087 this_ptr_conv.is_owned = false;
32088 ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val);
32091 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1forwarding_1info(JNIEnv *env, jclass clz, int64_t this_ptr) {
32092 LDKChannelCounterparty this_ptr_conv;
32093 this_ptr_conv.inner = untag_ptr(this_ptr);
32094 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32095 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32096 this_ptr_conv.is_owned = false;
32097 LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv);
32098 int64_t ret_ref = 0;
32099 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32100 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32104 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1set_1forwarding_1info(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32105 LDKChannelCounterparty this_ptr_conv;
32106 this_ptr_conv.inner = untag_ptr(this_ptr);
32107 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32108 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32109 this_ptr_conv.is_owned = false;
32110 LDKCounterpartyForwardingInfo val_conv;
32111 val_conv.inner = untag_ptr(val);
32112 val_conv.is_owned = ptr_is_owned(val);
32113 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32114 val_conv = CounterpartyForwardingInfo_clone(&val_conv);
32115 ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv);
32118 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1outbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
32119 LDKChannelCounterparty this_ptr_conv;
32120 this_ptr_conv.inner = untag_ptr(this_ptr);
32121 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32122 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32123 this_ptr_conv.is_owned = false;
32124 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
32125 *ret_copy = ChannelCounterparty_get_outbound_htlc_minimum_msat(&this_ptr_conv);
32126 int64_t ret_ref = tag_ptr(ret_copy, true);
32130 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) {
32131 LDKChannelCounterparty this_ptr_conv;
32132 this_ptr_conv.inner = untag_ptr(this_ptr);
32133 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32134 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32135 this_ptr_conv.is_owned = false;
32136 void* val_ptr = untag_ptr(val);
32137 CHECK_ACCESS(val_ptr);
32138 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
32139 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
32140 ChannelCounterparty_set_outbound_htlc_minimum_msat(&this_ptr_conv, val_conv);
32143 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1get_1outbound_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
32144 LDKChannelCounterparty this_ptr_conv;
32145 this_ptr_conv.inner = untag_ptr(this_ptr);
32146 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32147 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32148 this_ptr_conv.is_owned = false;
32149 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
32150 *ret_copy = ChannelCounterparty_get_outbound_htlc_maximum_msat(&this_ptr_conv);
32151 int64_t ret_ref = tag_ptr(ret_copy, true);
32155 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) {
32156 LDKChannelCounterparty this_ptr_conv;
32157 this_ptr_conv.inner = untag_ptr(this_ptr);
32158 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32159 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32160 this_ptr_conv.is_owned = false;
32161 void* val_ptr = untag_ptr(val);
32162 CHECK_ACCESS(val_ptr);
32163 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
32164 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
32165 ChannelCounterparty_set_outbound_htlc_maximum_msat(&this_ptr_conv, val_conv);
32168 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) {
32169 LDKPublicKey node_id_arg_ref;
32170 CHECK((*env)->GetArrayLength(env, node_id_arg) == 33);
32171 (*env)->GetByteArrayRegion(env, node_id_arg, 0, 33, node_id_arg_ref.compressed_form);
32172 LDKInitFeatures features_arg_conv;
32173 features_arg_conv.inner = untag_ptr(features_arg);
32174 features_arg_conv.is_owned = ptr_is_owned(features_arg);
32175 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
32176 features_arg_conv = InitFeatures_clone(&features_arg_conv);
32177 LDKCounterpartyForwardingInfo forwarding_info_arg_conv;
32178 forwarding_info_arg_conv.inner = untag_ptr(forwarding_info_arg);
32179 forwarding_info_arg_conv.is_owned = ptr_is_owned(forwarding_info_arg);
32180 CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv);
32181 forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv);
32182 void* outbound_htlc_minimum_msat_arg_ptr = untag_ptr(outbound_htlc_minimum_msat_arg);
32183 CHECK_ACCESS(outbound_htlc_minimum_msat_arg_ptr);
32184 LDKCOption_u64Z outbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_minimum_msat_arg_ptr);
32185 outbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_minimum_msat_arg));
32186 void* outbound_htlc_maximum_msat_arg_ptr = untag_ptr(outbound_htlc_maximum_msat_arg);
32187 CHECK_ACCESS(outbound_htlc_maximum_msat_arg_ptr);
32188 LDKCOption_u64Z outbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_maximum_msat_arg_ptr);
32189 outbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_maximum_msat_arg));
32190 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);
32191 int64_t ret_ref = 0;
32192 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32193 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32197 static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) {
32198 LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg);
32199 int64_t ret_ref = 0;
32200 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32201 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32204 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
32205 LDKChannelCounterparty arg_conv;
32206 arg_conv.inner = untag_ptr(arg);
32207 arg_conv.is_owned = ptr_is_owned(arg);
32208 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32209 arg_conv.is_owned = false;
32210 int64_t ret_conv = ChannelCounterparty_clone_ptr(&arg_conv);
32214 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1clone(JNIEnv *env, jclass clz, int64_t orig) {
32215 LDKChannelCounterparty orig_conv;
32216 orig_conv.inner = untag_ptr(orig);
32217 orig_conv.is_owned = ptr_is_owned(orig);
32218 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32219 orig_conv.is_owned = false;
32220 LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_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_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
32228 LDKChannelDetails this_obj_conv;
32229 this_obj_conv.inner = untag_ptr(this_obj);
32230 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32231 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32232 ChannelDetails_free(this_obj_conv);
32235 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32236 LDKChannelDetails this_ptr_conv;
32237 this_ptr_conv.inner = untag_ptr(this_ptr);
32238 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32239 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32240 this_ptr_conv.is_owned = false;
32241 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
32242 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(&this_ptr_conv));
32246 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
32247 LDKChannelDetails this_ptr_conv;
32248 this_ptr_conv.inner = untag_ptr(this_ptr);
32249 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32250 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32251 this_ptr_conv.is_owned = false;
32252 LDKThirtyTwoBytes val_ref;
32253 CHECK((*env)->GetArrayLength(env, val) == 32);
32254 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
32255 ChannelDetails_set_channel_id(&this_ptr_conv, val_ref);
32258 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty(JNIEnv *env, jclass clz, int64_t this_ptr) {
32259 LDKChannelDetails this_ptr_conv;
32260 this_ptr_conv.inner = untag_ptr(this_ptr);
32261 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32262 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32263 this_ptr_conv.is_owned = false;
32264 LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv);
32265 int64_t ret_ref = 0;
32266 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32267 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32271 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32272 LDKChannelDetails this_ptr_conv;
32273 this_ptr_conv.inner = untag_ptr(this_ptr);
32274 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32276 this_ptr_conv.is_owned = false;
32277 LDKChannelCounterparty val_conv;
32278 val_conv.inner = untag_ptr(val);
32279 val_conv.is_owned = ptr_is_owned(val);
32280 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32281 val_conv = ChannelCounterparty_clone(&val_conv);
32282 ChannelDetails_set_counterparty(&this_ptr_conv, val_conv);
32285 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_ptr) {
32286 LDKChannelDetails this_ptr_conv;
32287 this_ptr_conv.inner = untag_ptr(this_ptr);
32288 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32289 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32290 this_ptr_conv.is_owned = false;
32291 LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv);
32292 int64_t ret_ref = 0;
32293 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32294 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32298 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1funding_1txo(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32299 LDKChannelDetails this_ptr_conv;
32300 this_ptr_conv.inner = untag_ptr(this_ptr);
32301 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32302 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32303 this_ptr_conv.is_owned = false;
32304 LDKOutPoint val_conv;
32305 val_conv.inner = untag_ptr(val);
32306 val_conv.is_owned = ptr_is_owned(val);
32307 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32308 val_conv = OutPoint_clone(&val_conv);
32309 ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv);
32312 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) {
32313 LDKChannelDetails this_ptr_conv;
32314 this_ptr_conv.inner = untag_ptr(this_ptr);
32315 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32316 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32317 this_ptr_conv.is_owned = false;
32318 LDKChannelTypeFeatures ret_var = ChannelDetails_get_channel_type(&this_ptr_conv);
32319 int64_t ret_ref = 0;
32320 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32321 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32325 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32326 LDKChannelDetails this_ptr_conv;
32327 this_ptr_conv.inner = untag_ptr(this_ptr);
32328 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32329 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32330 this_ptr_conv.is_owned = false;
32331 LDKChannelTypeFeatures val_conv;
32332 val_conv.inner = untag_ptr(val);
32333 val_conv.is_owned = ptr_is_owned(val);
32334 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32335 val_conv = ChannelTypeFeatures_clone(&val_conv);
32336 ChannelDetails_set_channel_type(&this_ptr_conv, val_conv);
32339 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32340 LDKChannelDetails this_ptr_conv;
32341 this_ptr_conv.inner = untag_ptr(this_ptr);
32342 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32343 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32344 this_ptr_conv.is_owned = false;
32345 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
32346 *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv);
32347 int64_t ret_ref = tag_ptr(ret_copy, true);
32351 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32352 LDKChannelDetails this_ptr_conv;
32353 this_ptr_conv.inner = untag_ptr(this_ptr);
32354 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32355 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32356 this_ptr_conv.is_owned = false;
32357 void* val_ptr = untag_ptr(val);
32358 CHECK_ACCESS(val_ptr);
32359 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
32360 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
32361 ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv);
32364 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) {
32365 LDKChannelDetails this_ptr_conv;
32366 this_ptr_conv.inner = untag_ptr(this_ptr);
32367 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32368 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32369 this_ptr_conv.is_owned = false;
32370 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
32371 *ret_copy = ChannelDetails_get_outbound_scid_alias(&this_ptr_conv);
32372 int64_t ret_ref = tag_ptr(ret_copy, true);
32376 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1scid_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32377 LDKChannelDetails this_ptr_conv;
32378 this_ptr_conv.inner = untag_ptr(this_ptr);
32379 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32380 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32381 this_ptr_conv.is_owned = false;
32382 void* val_ptr = untag_ptr(val);
32383 CHECK_ACCESS(val_ptr);
32384 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
32385 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
32386 ChannelDetails_set_outbound_scid_alias(&this_ptr_conv, val_conv);
32389 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1scid_1alias(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_inbound_scid_alias(&this_ptr_conv);
32397 int64_t ret_ref = tag_ptr(ret_copy, true);
32401 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1scid_1alias(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_inbound_scid_alias(&this_ptr_conv, val_conv);
32414 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(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 int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv);
32424 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32425 LDKChannelDetails this_ptr_conv;
32426 this_ptr_conv.inner = untag_ptr(this_ptr);
32427 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32428 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32429 this_ptr_conv.is_owned = false;
32430 ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val);
32433 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr) {
32434 LDKChannelDetails this_ptr_conv;
32435 this_ptr_conv.inner = untag_ptr(this_ptr);
32436 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32437 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32438 this_ptr_conv.is_owned = false;
32439 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
32440 *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv);
32441 int64_t ret_ref = tag_ptr(ret_copy, true);
32445 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1unspendable_1punishment_1reserve(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32446 LDKChannelDetails this_ptr_conv;
32447 this_ptr_conv.inner = untag_ptr(this_ptr);
32448 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32449 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32450 this_ptr_conv.is_owned = false;
32451 void* val_ptr = untag_ptr(val);
32452 CHECK_ACCESS(val_ptr);
32453 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
32454 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
32455 ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv);
32458 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
32459 LDKChannelDetails this_ptr_conv;
32460 this_ptr_conv.inner = untag_ptr(this_ptr);
32461 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32462 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32463 this_ptr_conv.is_owned = false;
32464 int8_tArray ret_arr = (*env)->NewByteArray(env, 16);
32465 (*env)->SetByteArrayRegion(env, ret_arr, 0, 16, ChannelDetails_get_user_channel_id(&this_ptr_conv).le_bytes);
32469 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
32470 LDKChannelDetails this_ptr_conv;
32471 this_ptr_conv.inner = untag_ptr(this_ptr);
32472 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32473 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32474 this_ptr_conv.is_owned = false;
32476 CHECK((*env)->GetArrayLength(env, val) == 16);
32477 (*env)->GetByteArrayRegion(env, val, 0, 16, val_ref.le_bytes);
32478 ChannelDetails_set_user_channel_id(&this_ptr_conv, val_ref);
32481 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1feerate_1sat_1per_11000_1weight(JNIEnv *env, jclass clz, int64_t this_ptr) {
32482 LDKChannelDetails this_ptr_conv;
32483 this_ptr_conv.inner = untag_ptr(this_ptr);
32484 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32485 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32486 this_ptr_conv.is_owned = false;
32487 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
32488 *ret_copy = ChannelDetails_get_feerate_sat_per_1000_weight(&this_ptr_conv);
32489 int64_t ret_ref = tag_ptr(ret_copy, true);
32493 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1feerate_1sat_1per_11000_1weight(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32494 LDKChannelDetails this_ptr_conv;
32495 this_ptr_conv.inner = untag_ptr(this_ptr);
32496 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32497 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32498 this_ptr_conv.is_owned = false;
32499 void* val_ptr = untag_ptr(val);
32500 CHECK_ACCESS(val_ptr);
32501 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
32502 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
32503 ChannelDetails_set_feerate_sat_per_1000_weight(&this_ptr_conv, val_conv);
32506 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1balance_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
32507 LDKChannelDetails this_ptr_conv;
32508 this_ptr_conv.inner = untag_ptr(this_ptr);
32509 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32510 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32511 this_ptr_conv.is_owned = false;
32512 int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv);
32516 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1balance_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32517 LDKChannelDetails this_ptr_conv;
32518 this_ptr_conv.inner = untag_ptr(this_ptr);
32519 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32520 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32521 this_ptr_conv.is_owned = false;
32522 ChannelDetails_set_balance_msat(&this_ptr_conv, val);
32525 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
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 int64_t ret_conv = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv);
32535 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32536 LDKChannelDetails this_ptr_conv;
32537 this_ptr_conv.inner = untag_ptr(this_ptr);
32538 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32539 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32540 this_ptr_conv.is_owned = false;
32541 ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val);
32544 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1next_1outbound_1htlc_1limit_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
32545 LDKChannelDetails this_ptr_conv;
32546 this_ptr_conv.inner = untag_ptr(this_ptr);
32547 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32548 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32549 this_ptr_conv.is_owned = false;
32550 int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_limit_msat(&this_ptr_conv);
32554 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) {
32555 LDKChannelDetails this_ptr_conv;
32556 this_ptr_conv.inner = untag_ptr(this_ptr);
32557 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32558 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32559 this_ptr_conv.is_owned = false;
32560 ChannelDetails_set_next_outbound_htlc_limit_msat(&this_ptr_conv, val);
32563 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(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 int64_t ret_conv = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv);
32573 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32574 LDKChannelDetails this_ptr_conv;
32575 this_ptr_conv.inner = untag_ptr(this_ptr);
32576 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32577 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32578 this_ptr_conv.is_owned = false;
32579 ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val);
32582 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1confirmations_1required(JNIEnv *env, jclass clz, int64_t this_ptr) {
32583 LDKChannelDetails this_ptr_conv;
32584 this_ptr_conv.inner = untag_ptr(this_ptr);
32585 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32586 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32587 this_ptr_conv.is_owned = false;
32588 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
32589 *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv);
32590 int64_t ret_ref = tag_ptr(ret_copy, true);
32594 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmations_1required(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32595 LDKChannelDetails this_ptr_conv;
32596 this_ptr_conv.inner = untag_ptr(this_ptr);
32597 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32598 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32599 this_ptr_conv.is_owned = false;
32600 void* val_ptr = untag_ptr(val);
32601 CHECK_ACCESS(val_ptr);
32602 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
32603 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
32604 ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv);
32607 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1confirmations(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 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
32614 *ret_copy = ChannelDetails_get_confirmations(&this_ptr_conv);
32615 int64_t ret_ref = tag_ptr(ret_copy, true);
32619 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmations(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32620 LDKChannelDetails this_ptr_conv;
32621 this_ptr_conv.inner = untag_ptr(this_ptr);
32622 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32623 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32624 this_ptr_conv.is_owned = false;
32625 void* val_ptr = untag_ptr(val);
32626 CHECK_ACCESS(val_ptr);
32627 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
32628 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
32629 ChannelDetails_set_confirmations(&this_ptr_conv, val_conv);
32632 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1force_1close_1spend_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
32633 LDKChannelDetails this_ptr_conv;
32634 this_ptr_conv.inner = untag_ptr(this_ptr);
32635 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32636 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32637 this_ptr_conv.is_owned = false;
32638 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
32639 *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv);
32640 int64_t ret_ref = tag_ptr(ret_copy, true);
32644 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) {
32645 LDKChannelDetails this_ptr_conv;
32646 this_ptr_conv.inner = untag_ptr(this_ptr);
32647 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32648 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32649 this_ptr_conv.is_owned = false;
32650 void* val_ptr = untag_ptr(val);
32651 CHECK_ACCESS(val_ptr);
32652 LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr);
32653 val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val));
32654 ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv);
32657 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_ptr) {
32658 LDKChannelDetails this_ptr_conv;
32659 this_ptr_conv.inner = untag_ptr(this_ptr);
32660 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32661 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32662 this_ptr_conv.is_owned = false;
32663 jboolean ret_conv = ChannelDetails_get_is_outbound(&this_ptr_conv);
32667 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
32668 LDKChannelDetails this_ptr_conv;
32669 this_ptr_conv.inner = untag_ptr(this_ptr);
32670 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32671 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32672 this_ptr_conv.is_owned = false;
32673 ChannelDetails_set_is_outbound(&this_ptr_conv, val);
32676 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1channel_1ready(JNIEnv *env, jclass clz, int64_t this_ptr) {
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 jboolean ret_conv = ChannelDetails_get_is_channel_ready(&this_ptr_conv);
32686 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1channel_1ready(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
32687 LDKChannelDetails this_ptr_conv;
32688 this_ptr_conv.inner = untag_ptr(this_ptr);
32689 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32690 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32691 this_ptr_conv.is_owned = false;
32692 ChannelDetails_set_is_channel_ready(&this_ptr_conv, val);
32695 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1usable(JNIEnv *env, jclass clz, int64_t this_ptr) {
32696 LDKChannelDetails this_ptr_conv;
32697 this_ptr_conv.inner = untag_ptr(this_ptr);
32698 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32699 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32700 this_ptr_conv.is_owned = false;
32701 jboolean ret_conv = ChannelDetails_get_is_usable(&this_ptr_conv);
32705 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1usable(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
32706 LDKChannelDetails this_ptr_conv;
32707 this_ptr_conv.inner = untag_ptr(this_ptr);
32708 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32709 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32710 this_ptr_conv.is_owned = false;
32711 ChannelDetails_set_is_usable(&this_ptr_conv, val);
32714 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1public(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 jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv);
32724 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1public(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
32725 LDKChannelDetails this_ptr_conv;
32726 this_ptr_conv.inner = untag_ptr(this_ptr);
32727 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32728 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32729 this_ptr_conv.is_owned = false;
32730 ChannelDetails_set_is_public(&this_ptr_conv, val);
32733 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
32734 LDKChannelDetails this_ptr_conv;
32735 this_ptr_conv.inner = untag_ptr(this_ptr);
32736 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32737 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32738 this_ptr_conv.is_owned = false;
32739 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
32740 *ret_copy = ChannelDetails_get_inbound_htlc_minimum_msat(&this_ptr_conv);
32741 int64_t ret_ref = tag_ptr(ret_copy, true);
32745 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) {
32746 LDKChannelDetails this_ptr_conv;
32747 this_ptr_conv.inner = untag_ptr(this_ptr);
32748 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32749 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32750 this_ptr_conv.is_owned = false;
32751 void* val_ptr = untag_ptr(val);
32752 CHECK_ACCESS(val_ptr);
32753 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
32754 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
32755 ChannelDetails_set_inbound_htlc_minimum_msat(&this_ptr_conv, val_conv);
32758 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
32759 LDKChannelDetails this_ptr_conv;
32760 this_ptr_conv.inner = untag_ptr(this_ptr);
32761 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32762 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32763 this_ptr_conv.is_owned = false;
32764 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
32765 *ret_copy = ChannelDetails_get_inbound_htlc_maximum_msat(&this_ptr_conv);
32766 int64_t ret_ref = tag_ptr(ret_copy, true);
32770 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) {
32771 LDKChannelDetails this_ptr_conv;
32772 this_ptr_conv.inner = untag_ptr(this_ptr);
32773 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32774 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32775 this_ptr_conv.is_owned = false;
32776 void* val_ptr = untag_ptr(val);
32777 CHECK_ACCESS(val_ptr);
32778 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
32779 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
32780 ChannelDetails_set_inbound_htlc_maximum_msat(&this_ptr_conv, val_conv);
32783 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1config(JNIEnv *env, jclass clz, int64_t this_ptr) {
32784 LDKChannelDetails this_ptr_conv;
32785 this_ptr_conv.inner = untag_ptr(this_ptr);
32786 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32787 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32788 this_ptr_conv.is_owned = false;
32789 LDKChannelConfig ret_var = ChannelDetails_get_config(&this_ptr_conv);
32790 int64_t ret_ref = 0;
32791 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32792 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32796 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
32797 LDKChannelDetails this_ptr_conv;
32798 this_ptr_conv.inner = untag_ptr(this_ptr);
32799 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32800 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32801 this_ptr_conv.is_owned = false;
32802 LDKChannelConfig val_conv;
32803 val_conv.inner = untag_ptr(val);
32804 val_conv.is_owned = ptr_is_owned(val);
32805 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32806 val_conv = ChannelConfig_clone(&val_conv);
32807 ChannelDetails_set_config(&this_ptr_conv, val_conv);
32810 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 feerate_sat_per_1000_weight_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) {
32811 LDKThirtyTwoBytes channel_id_arg_ref;
32812 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
32813 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
32814 LDKChannelCounterparty counterparty_arg_conv;
32815 counterparty_arg_conv.inner = untag_ptr(counterparty_arg);
32816 counterparty_arg_conv.is_owned = ptr_is_owned(counterparty_arg);
32817 CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv);
32818 counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv);
32819 LDKOutPoint funding_txo_arg_conv;
32820 funding_txo_arg_conv.inner = untag_ptr(funding_txo_arg);
32821 funding_txo_arg_conv.is_owned = ptr_is_owned(funding_txo_arg);
32822 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv);
32823 funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv);
32824 LDKChannelTypeFeatures channel_type_arg_conv;
32825 channel_type_arg_conv.inner = untag_ptr(channel_type_arg);
32826 channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg);
32827 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv);
32828 channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv);
32829 void* short_channel_id_arg_ptr = untag_ptr(short_channel_id_arg);
32830 CHECK_ACCESS(short_channel_id_arg_ptr);
32831 LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr);
32832 short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_arg));
32833 void* outbound_scid_alias_arg_ptr = untag_ptr(outbound_scid_alias_arg);
32834 CHECK_ACCESS(outbound_scid_alias_arg_ptr);
32835 LDKCOption_u64Z outbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(outbound_scid_alias_arg_ptr);
32836 outbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_scid_alias_arg));
32837 void* inbound_scid_alias_arg_ptr = untag_ptr(inbound_scid_alias_arg);
32838 CHECK_ACCESS(inbound_scid_alias_arg_ptr);
32839 LDKCOption_u64Z inbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(inbound_scid_alias_arg_ptr);
32840 inbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_scid_alias_arg));
32841 void* unspendable_punishment_reserve_arg_ptr = untag_ptr(unspendable_punishment_reserve_arg);
32842 CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr);
32843 LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr);
32844 LDKU128 user_channel_id_arg_ref;
32845 CHECK((*env)->GetArrayLength(env, user_channel_id_arg) == 16);
32846 (*env)->GetByteArrayRegion(env, user_channel_id_arg, 0, 16, user_channel_id_arg_ref.le_bytes);
32847 void* feerate_sat_per_1000_weight_arg_ptr = untag_ptr(feerate_sat_per_1000_weight_arg);
32848 CHECK_ACCESS(feerate_sat_per_1000_weight_arg_ptr);
32849 LDKCOption_u32Z feerate_sat_per_1000_weight_arg_conv = *(LDKCOption_u32Z*)(feerate_sat_per_1000_weight_arg_ptr);
32850 feerate_sat_per_1000_weight_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(feerate_sat_per_1000_weight_arg));
32851 void* confirmations_required_arg_ptr = untag_ptr(confirmations_required_arg);
32852 CHECK_ACCESS(confirmations_required_arg_ptr);
32853 LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr);
32854 confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_required_arg));
32855 void* confirmations_arg_ptr = untag_ptr(confirmations_arg);
32856 CHECK_ACCESS(confirmations_arg_ptr);
32857 LDKCOption_u32Z confirmations_arg_conv = *(LDKCOption_u32Z*)(confirmations_arg_ptr);
32858 confirmations_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_arg));
32859 void* force_close_spend_delay_arg_ptr = untag_ptr(force_close_spend_delay_arg);
32860 CHECK_ACCESS(force_close_spend_delay_arg_ptr);
32861 LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr);
32862 force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(force_close_spend_delay_arg));
32863 void* inbound_htlc_minimum_msat_arg_ptr = untag_ptr(inbound_htlc_minimum_msat_arg);
32864 CHECK_ACCESS(inbound_htlc_minimum_msat_arg_ptr);
32865 LDKCOption_u64Z inbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_minimum_msat_arg_ptr);
32866 inbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_minimum_msat_arg));
32867 void* inbound_htlc_maximum_msat_arg_ptr = untag_ptr(inbound_htlc_maximum_msat_arg);
32868 CHECK_ACCESS(inbound_htlc_maximum_msat_arg_ptr);
32869 LDKCOption_u64Z inbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_maximum_msat_arg_ptr);
32870 inbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_maximum_msat_arg));
32871 LDKChannelConfig config_arg_conv;
32872 config_arg_conv.inner = untag_ptr(config_arg);
32873 config_arg_conv.is_owned = ptr_is_owned(config_arg);
32874 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_arg_conv);
32875 config_arg_conv = ChannelConfig_clone(&config_arg_conv);
32876 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, feerate_sat_per_1000_weight_arg_conv, 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);
32877 int64_t ret_ref = 0;
32878 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32879 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32883 static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) {
32884 LDKChannelDetails ret_var = ChannelDetails_clone(arg);
32885 int64_t ret_ref = 0;
32886 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32887 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32890 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
32891 LDKChannelDetails arg_conv;
32892 arg_conv.inner = untag_ptr(arg);
32893 arg_conv.is_owned = ptr_is_owned(arg);
32894 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32895 arg_conv.is_owned = false;
32896 int64_t ret_conv = ChannelDetails_clone_ptr(&arg_conv);
32900 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1clone(JNIEnv *env, jclass clz, int64_t orig) {
32901 LDKChannelDetails orig_conv;
32902 orig_conv.inner = untag_ptr(orig);
32903 orig_conv.is_owned = ptr_is_owned(orig);
32904 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32905 orig_conv.is_owned = false;
32906 LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv);
32907 int64_t ret_ref = 0;
32908 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32909 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32913 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1payment_1scid(JNIEnv *env, jclass clz, int64_t this_arg) {
32914 LDKChannelDetails this_arg_conv;
32915 this_arg_conv.inner = untag_ptr(this_arg);
32916 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32917 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32918 this_arg_conv.is_owned = false;
32919 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
32920 *ret_copy = ChannelDetails_get_inbound_payment_scid(&this_arg_conv);
32921 int64_t ret_ref = tag_ptr(ret_copy, true);
32925 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1payment_1scid(JNIEnv *env, jclass clz, int64_t this_arg) {
32926 LDKChannelDetails this_arg_conv;
32927 this_arg_conv.inner = untag_ptr(this_arg);
32928 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32929 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32930 this_arg_conv.is_owned = false;
32931 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
32932 *ret_copy = ChannelDetails_get_outbound_payment_scid(&this_arg_conv);
32933 int64_t ret_ref = tag_ptr(ret_copy, true);
32937 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecentPaymentDetails_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
32938 if (!ptr_is_owned(this_ptr)) return;
32939 void* this_ptr_ptr = untag_ptr(this_ptr);
32940 CHECK_ACCESS(this_ptr_ptr);
32941 LDKRecentPaymentDetails this_ptr_conv = *(LDKRecentPaymentDetails*)(this_ptr_ptr);
32942 FREE(untag_ptr(this_ptr));
32943 RecentPaymentDetails_free(this_ptr_conv);
32946 static inline uint64_t RecentPaymentDetails_clone_ptr(LDKRecentPaymentDetails *NONNULL_PTR arg) {
32947 LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails");
32948 *ret_copy = RecentPaymentDetails_clone(arg);
32949 int64_t ret_ref = tag_ptr(ret_copy, true);
32952 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecentPaymentDetails_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
32953 LDKRecentPaymentDetails* arg_conv = (LDKRecentPaymentDetails*)untag_ptr(arg);
32954 int64_t ret_conv = RecentPaymentDetails_clone_ptr(arg_conv);
32958 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecentPaymentDetails_1clone(JNIEnv *env, jclass clz, int64_t orig) {
32959 LDKRecentPaymentDetails* orig_conv = (LDKRecentPaymentDetails*)untag_ptr(orig);
32960 LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails");
32961 *ret_copy = RecentPaymentDetails_clone(orig_conv);
32962 int64_t ret_ref = tag_ptr(ret_copy, true);
32966 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecentPaymentDetails_1pending(JNIEnv *env, jclass clz, int8_tArray payment_hash, int64_t total_msat) {
32967 LDKThirtyTwoBytes payment_hash_ref;
32968 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
32969 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
32970 LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails");
32971 *ret_copy = RecentPaymentDetails_pending(payment_hash_ref, total_msat);
32972 int64_t ret_ref = tag_ptr(ret_copy, true);
32976 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecentPaymentDetails_1fulfilled(JNIEnv *env, jclass clz, int8_tArray payment_hash) {
32977 LDKThirtyTwoBytes payment_hash_ref;
32978 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
32979 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
32980 LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails");
32981 *ret_copy = RecentPaymentDetails_fulfilled(payment_hash_ref);
32982 int64_t ret_ref = tag_ptr(ret_copy, true);
32986 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecentPaymentDetails_1abandoned(JNIEnv *env, jclass clz, int8_tArray payment_hash) {
32987 LDKThirtyTwoBytes payment_hash_ref;
32988 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
32989 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
32990 LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails");
32991 *ret_copy = RecentPaymentDetails_abandoned(payment_hash_ref);
32992 int64_t ret_ref = tag_ptr(ret_copy, true);
32996 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
32997 LDKPhantomRouteHints this_obj_conv;
32998 this_obj_conv.inner = untag_ptr(this_obj);
32999 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33000 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33001 PhantomRouteHints_free(this_obj_conv);
33004 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
33005 LDKPhantomRouteHints this_ptr_conv;
33006 this_ptr_conv.inner = untag_ptr(this_ptr);
33007 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33008 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33009 this_ptr_conv.is_owned = false;
33010 LDKCVec_ChannelDetailsZ ret_var = PhantomRouteHints_get_channels(&this_ptr_conv);
33011 int64_tArray ret_arr = NULL;
33012 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
33013 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
33014 for (size_t q = 0; q < ret_var.datalen; q++) {
33015 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
33016 int64_t ret_conv_16_ref = 0;
33017 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
33018 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
33019 ret_arr_ptr[q] = ret_conv_16_ref;
33021 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
33022 FREE(ret_var.data);
33026 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
33027 LDKPhantomRouteHints this_ptr_conv;
33028 this_ptr_conv.inner = untag_ptr(this_ptr);
33029 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33030 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33031 this_ptr_conv.is_owned = false;
33032 LDKCVec_ChannelDetailsZ val_constr;
33033 val_constr.datalen = (*env)->GetArrayLength(env, val);
33034 if (val_constr.datalen > 0)
33035 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
33037 val_constr.data = NULL;
33038 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
33039 for (size_t q = 0; q < val_constr.datalen; q++) {
33040 int64_t val_conv_16 = val_vals[q];
33041 LDKChannelDetails val_conv_16_conv;
33042 val_conv_16_conv.inner = untag_ptr(val_conv_16);
33043 val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16);
33044 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv);
33045 val_conv_16_conv = ChannelDetails_clone(&val_conv_16_conv);
33046 val_constr.data[q] = val_conv_16_conv;
33048 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
33049 PhantomRouteHints_set_channels(&this_ptr_conv, val_constr);
33052 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_ptr) {
33053 LDKPhantomRouteHints this_ptr_conv;
33054 this_ptr_conv.inner = untag_ptr(this_ptr);
33055 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33056 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33057 this_ptr_conv.is_owned = false;
33058 int64_t ret_conv = PhantomRouteHints_get_phantom_scid(&this_ptr_conv);
33062 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1phantom_1scid(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
33063 LDKPhantomRouteHints this_ptr_conv;
33064 this_ptr_conv.inner = untag_ptr(this_ptr);
33065 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33066 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33067 this_ptr_conv.is_owned = false;
33068 PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val);
33071 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1get_1real_1node_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
33072 LDKPhantomRouteHints this_ptr_conv;
33073 this_ptr_conv.inner = untag_ptr(this_ptr);
33074 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33075 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33076 this_ptr_conv.is_owned = false;
33077 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
33078 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form);
33082 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1set_1real_1node_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
33083 LDKPhantomRouteHints this_ptr_conv;
33084 this_ptr_conv.inner = untag_ptr(this_ptr);
33085 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33086 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33087 this_ptr_conv.is_owned = false;
33088 LDKPublicKey val_ref;
33089 CHECK((*env)->GetArrayLength(env, val) == 33);
33090 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
33091 PhantomRouteHints_set_real_node_pubkey(&this_ptr_conv, val_ref);
33094 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) {
33095 LDKCVec_ChannelDetailsZ channels_arg_constr;
33096 channels_arg_constr.datalen = (*env)->GetArrayLength(env, channels_arg);
33097 if (channels_arg_constr.datalen > 0)
33098 channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
33100 channels_arg_constr.data = NULL;
33101 int64_t* channels_arg_vals = (*env)->GetLongArrayElements (env, channels_arg, NULL);
33102 for (size_t q = 0; q < channels_arg_constr.datalen; q++) {
33103 int64_t channels_arg_conv_16 = channels_arg_vals[q];
33104 LDKChannelDetails channels_arg_conv_16_conv;
33105 channels_arg_conv_16_conv.inner = untag_ptr(channels_arg_conv_16);
33106 channels_arg_conv_16_conv.is_owned = ptr_is_owned(channels_arg_conv_16);
33107 CHECK_INNER_FIELD_ACCESS_OR_NULL(channels_arg_conv_16_conv);
33108 channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv);
33109 channels_arg_constr.data[q] = channels_arg_conv_16_conv;
33111 (*env)->ReleaseLongArrayElements(env, channels_arg, channels_arg_vals, 0);
33112 LDKPublicKey real_node_pubkey_arg_ref;
33113 CHECK((*env)->GetArrayLength(env, real_node_pubkey_arg) == 33);
33114 (*env)->GetByteArrayRegion(env, real_node_pubkey_arg, 0, 33, real_node_pubkey_arg_ref.compressed_form);
33115 LDKPhantomRouteHints ret_var = PhantomRouteHints_new(channels_arg_constr, phantom_scid_arg, real_node_pubkey_arg_ref);
33116 int64_t ret_ref = 0;
33117 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33118 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33122 static inline uint64_t PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg) {
33123 LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(arg);
33124 int64_t ret_ref = 0;
33125 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33126 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33129 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
33130 LDKPhantomRouteHints arg_conv;
33131 arg_conv.inner = untag_ptr(arg);
33132 arg_conv.is_owned = ptr_is_owned(arg);
33133 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33134 arg_conv.is_owned = false;
33135 int64_t ret_conv = PhantomRouteHints_clone_ptr(&arg_conv);
33139 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1clone(JNIEnv *env, jclass clz, int64_t orig) {
33140 LDKPhantomRouteHints orig_conv;
33141 orig_conv.inner = untag_ptr(orig);
33142 orig_conv.is_owned = ptr_is_owned(orig);
33143 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33144 orig_conv.is_owned = false;
33145 LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(&orig_conv);
33146 int64_t ret_ref = 0;
33147 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33148 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33152 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) {
33153 void* fee_est_ptr = untag_ptr(fee_est);
33154 CHECK_ACCESS(fee_est_ptr);
33155 LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr);
33156 if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
33157 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33158 LDKFeeEstimator_JCalls_cloned(&fee_est_conv);
33160 void* chain_monitor_ptr = untag_ptr(chain_monitor);
33161 CHECK_ACCESS(chain_monitor_ptr);
33162 LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
33163 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
33164 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33165 LDKWatch_JCalls_cloned(&chain_monitor_conv);
33167 void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster);
33168 CHECK_ACCESS(tx_broadcaster_ptr);
33169 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
33170 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
33171 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33172 LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
33174 void* router_ptr = untag_ptr(router);
33175 CHECK_ACCESS(router_ptr);
33176 LDKRouter router_conv = *(LDKRouter*)(router_ptr);
33177 if (router_conv.free == LDKRouter_JCalls_free) {
33178 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33179 LDKRouter_JCalls_cloned(&router_conv);
33181 void* logger_ptr = untag_ptr(logger);
33182 CHECK_ACCESS(logger_ptr);
33183 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
33184 if (logger_conv.free == LDKLogger_JCalls_free) {
33185 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33186 LDKLogger_JCalls_cloned(&logger_conv);
33188 void* entropy_source_ptr = untag_ptr(entropy_source);
33189 CHECK_ACCESS(entropy_source_ptr);
33190 LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr);
33191 if (entropy_source_conv.free == LDKEntropySource_JCalls_free) {
33192 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33193 LDKEntropySource_JCalls_cloned(&entropy_source_conv);
33195 void* node_signer_ptr = untag_ptr(node_signer);
33196 CHECK_ACCESS(node_signer_ptr);
33197 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
33198 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
33199 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33200 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
33202 void* signer_provider_ptr = untag_ptr(signer_provider);
33203 CHECK_ACCESS(signer_provider_ptr);
33204 LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr);
33205 if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) {
33206 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33207 LDKSignerProvider_JCalls_cloned(&signer_provider_conv);
33209 LDKUserConfig config_conv;
33210 config_conv.inner = untag_ptr(config);
33211 config_conv.is_owned = ptr_is_owned(config);
33212 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv);
33213 config_conv = UserConfig_clone(&config_conv);
33214 LDKChainParameters params_conv;
33215 params_conv.inner = untag_ptr(params);
33216 params_conv.is_owned = ptr_is_owned(params);
33217 CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
33218 params_conv = ChainParameters_clone(¶ms_conv);
33219 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);
33220 int64_t ret_ref = 0;
33221 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33222 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33226 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1current_1default_1configuration(JNIEnv *env, jclass clz, int64_t this_arg) {
33227 LDKChannelManager this_arg_conv;
33228 this_arg_conv.inner = untag_ptr(this_arg);
33229 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33230 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33231 this_arg_conv.is_owned = false;
33232 LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv);
33233 int64_t ret_ref = 0;
33234 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33235 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33239 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) {
33240 LDKChannelManager this_arg_conv;
33241 this_arg_conv.inner = untag_ptr(this_arg);
33242 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33243 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33244 this_arg_conv.is_owned = false;
33245 LDKPublicKey their_network_key_ref;
33246 CHECK((*env)->GetArrayLength(env, their_network_key) == 33);
33247 (*env)->GetByteArrayRegion(env, their_network_key, 0, 33, their_network_key_ref.compressed_form);
33248 LDKU128 user_channel_id_ref;
33249 CHECK((*env)->GetArrayLength(env, user_channel_id) == 16);
33250 (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes);
33251 LDKUserConfig override_config_conv;
33252 override_config_conv.inner = untag_ptr(override_config);
33253 override_config_conv.is_owned = ptr_is_owned(override_config);
33254 CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv);
33255 override_config_conv = UserConfig_clone(&override_config_conv);
33256 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
33257 *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id_ref, override_config_conv);
33258 return tag_ptr(ret_conv, true);
33261 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv *env, jclass clz, int64_t this_arg) {
33262 LDKChannelManager this_arg_conv;
33263 this_arg_conv.inner = untag_ptr(this_arg);
33264 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33265 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33266 this_arg_conv.is_owned = false;
33267 LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv);
33268 int64_tArray ret_arr = NULL;
33269 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
33270 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
33271 for (size_t q = 0; q < ret_var.datalen; q++) {
33272 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
33273 int64_t ret_conv_16_ref = 0;
33274 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
33275 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
33276 ret_arr_ptr[q] = ret_conv_16_ref;
33278 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
33279 FREE(ret_var.data);
33283 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv *env, jclass clz, int64_t this_arg) {
33284 LDKChannelManager this_arg_conv;
33285 this_arg_conv.inner = untag_ptr(this_arg);
33286 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33287 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33288 this_arg_conv.is_owned = false;
33289 LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv);
33290 int64_tArray ret_arr = NULL;
33291 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
33292 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
33293 for (size_t q = 0; q < ret_var.datalen; q++) {
33294 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
33295 int64_t ret_conv_16_ref = 0;
33296 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
33297 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
33298 ret_arr_ptr[q] = ret_conv_16_ref;
33300 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
33301 FREE(ret_var.data);
33305 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels_1with_1counterparty(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray counterparty_node_id) {
33306 LDKChannelManager this_arg_conv;
33307 this_arg_conv.inner = untag_ptr(this_arg);
33308 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33309 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33310 this_arg_conv.is_owned = false;
33311 LDKPublicKey counterparty_node_id_ref;
33312 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
33313 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
33314 LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels_with_counterparty(&this_arg_conv, counterparty_node_id_ref);
33315 int64_tArray ret_arr = NULL;
33316 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
33317 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
33318 for (size_t q = 0; q < ret_var.datalen; q++) {
33319 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
33320 int64_t ret_conv_16_ref = 0;
33321 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
33322 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
33323 ret_arr_ptr[q] = ret_conv_16_ref;
33325 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
33326 FREE(ret_var.data);
33330 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1recent_1payments(JNIEnv *env, jclass clz, int64_t this_arg) {
33331 LDKChannelManager this_arg_conv;
33332 this_arg_conv.inner = untag_ptr(this_arg);
33333 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33334 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33335 this_arg_conv.is_owned = false;
33336 LDKCVec_RecentPaymentDetailsZ ret_var = ChannelManager_list_recent_payments(&this_arg_conv);
33337 int64_tArray ret_arr = NULL;
33338 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
33339 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
33340 for (size_t w = 0; w < ret_var.datalen; w++) {
33341 LDKRecentPaymentDetails *ret_conv_22_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails");
33342 *ret_conv_22_copy = ret_var.data[w];
33343 int64_t ret_conv_22_ref = tag_ptr(ret_conv_22_copy, true);
33344 ret_arr_ptr[w] = ret_conv_22_ref;
33346 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
33347 FREE(ret_var.data);
33351 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) {
33352 LDKChannelManager this_arg_conv;
33353 this_arg_conv.inner = untag_ptr(this_arg);
33354 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33355 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33356 this_arg_conv.is_owned = false;
33357 uint8_t channel_id_arr[32];
33358 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
33359 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr);
33360 uint8_t (*channel_id_ref)[32] = &channel_id_arr;
33361 LDKPublicKey counterparty_node_id_ref;
33362 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
33363 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
33364 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33365 *ret_conv = ChannelManager_close_channel(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
33366 return tag_ptr(ret_conv, true);
33369 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) {
33370 LDKChannelManager this_arg_conv;
33371 this_arg_conv.inner = untag_ptr(this_arg);
33372 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33373 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33374 this_arg_conv.is_owned = false;
33375 uint8_t channel_id_arr[32];
33376 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
33377 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr);
33378 uint8_t (*channel_id_ref)[32] = &channel_id_arr;
33379 LDKPublicKey counterparty_node_id_ref;
33380 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
33381 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
33382 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33383 *ret_conv = ChannelManager_close_channel_with_target_feerate(&this_arg_conv, channel_id_ref, counterparty_node_id_ref, target_feerate_sats_per_1000_weight);
33384 return tag_ptr(ret_conv, true);
33387 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) {
33388 LDKChannelManager this_arg_conv;
33389 this_arg_conv.inner = untag_ptr(this_arg);
33390 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33391 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33392 this_arg_conv.is_owned = false;
33393 uint8_t channel_id_arr[32];
33394 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
33395 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr);
33396 uint8_t (*channel_id_ref)[32] = &channel_id_arr;
33397 LDKPublicKey counterparty_node_id_ref;
33398 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
33399 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
33400 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33401 *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
33402 return tag_ptr(ret_conv, true);
33405 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) {
33406 LDKChannelManager this_arg_conv;
33407 this_arg_conv.inner = untag_ptr(this_arg);
33408 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33409 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33410 this_arg_conv.is_owned = false;
33411 uint8_t channel_id_arr[32];
33412 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
33413 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_arr);
33414 uint8_t (*channel_id_ref)[32] = &channel_id_arr;
33415 LDKPublicKey counterparty_node_id_ref;
33416 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
33417 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
33418 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33419 *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
33420 return tag_ptr(ret_conv, true);
33423 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels_1broadcasting_1latest_1txn(JNIEnv *env, jclass clz, int64_t this_arg) {
33424 LDKChannelManager this_arg_conv;
33425 this_arg_conv.inner = untag_ptr(this_arg);
33426 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33427 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33428 this_arg_conv.is_owned = false;
33429 ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv);
33432 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels_1without_1broadcasting_1txn(JNIEnv *env, jclass clz, int64_t this_arg) {
33433 LDKChannelManager this_arg_conv;
33434 this_arg_conv.inner = untag_ptr(this_arg);
33435 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33436 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33437 this_arg_conv.is_owned = false;
33438 ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv);
33441 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment_1with_1route(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_hash, int64_t recipient_onion, int8_tArray payment_id) {
33442 LDKChannelManager this_arg_conv;
33443 this_arg_conv.inner = untag_ptr(this_arg);
33444 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33445 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33446 this_arg_conv.is_owned = false;
33447 LDKRoute route_conv;
33448 route_conv.inner = untag_ptr(route);
33449 route_conv.is_owned = ptr_is_owned(route);
33450 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
33451 route_conv.is_owned = false;
33452 LDKThirtyTwoBytes payment_hash_ref;
33453 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
33454 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
33455 LDKRecipientOnionFields recipient_onion_conv;
33456 recipient_onion_conv.inner = untag_ptr(recipient_onion);
33457 recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion);
33458 CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv);
33459 recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv);
33460 LDKThirtyTwoBytes payment_id_ref;
33461 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
33462 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
33463 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
33464 *ret_conv = ChannelManager_send_payment_with_route(&this_arg_conv, &route_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref);
33465 return tag_ptr(ret_conv, true);
33468 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash, int64_t recipient_onion, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) {
33469 LDKChannelManager this_arg_conv;
33470 this_arg_conv.inner = untag_ptr(this_arg);
33471 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33472 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33473 this_arg_conv.is_owned = false;
33474 LDKThirtyTwoBytes payment_hash_ref;
33475 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
33476 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
33477 LDKRecipientOnionFields recipient_onion_conv;
33478 recipient_onion_conv.inner = untag_ptr(recipient_onion);
33479 recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion);
33480 CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv);
33481 recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv);
33482 LDKThirtyTwoBytes payment_id_ref;
33483 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
33484 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
33485 LDKRouteParameters route_params_conv;
33486 route_params_conv.inner = untag_ptr(route_params);
33487 route_params_conv.is_owned = ptr_is_owned(route_params);
33488 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
33489 route_params_conv = RouteParameters_clone(&route_params_conv);
33490 void* retry_strategy_ptr = untag_ptr(retry_strategy);
33491 CHECK_ACCESS(retry_strategy_ptr);
33492 LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr);
33493 retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy));
33494 LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ");
33495 *ret_conv = ChannelManager_send_payment(&this_arg_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref, route_params_conv, retry_strategy_conv);
33496 return tag_ptr(ret_conv, true);
33499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1abandon_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id) {
33500 LDKChannelManager this_arg_conv;
33501 this_arg_conv.inner = untag_ptr(this_arg);
33502 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33503 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33504 this_arg_conv.is_owned = false;
33505 LDKThirtyTwoBytes payment_id_ref;
33506 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
33507 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
33508 ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref);
33511 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, int64_t recipient_onion, int8_tArray payment_id) {
33512 LDKChannelManager this_arg_conv;
33513 this_arg_conv.inner = untag_ptr(this_arg);
33514 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33515 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33516 this_arg_conv.is_owned = false;
33517 LDKRoute route_conv;
33518 route_conv.inner = untag_ptr(route);
33519 route_conv.is_owned = ptr_is_owned(route);
33520 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
33521 route_conv.is_owned = false;
33522 LDKThirtyTwoBytes payment_preimage_ref;
33523 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
33524 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
33525 LDKRecipientOnionFields recipient_onion_conv;
33526 recipient_onion_conv.inner = untag_ptr(recipient_onion);
33527 recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion);
33528 CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv);
33529 recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv);
33530 LDKThirtyTwoBytes payment_id_ref;
33531 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
33532 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
33533 LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
33534 *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref, recipient_onion_conv, payment_id_ref);
33535 return tag_ptr(ret_conv, true);
33538 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, int64_t recipient_onion, int8_tArray payment_id, int64_t route_params, int64_t retry_strategy) {
33539 LDKChannelManager this_arg_conv;
33540 this_arg_conv.inner = untag_ptr(this_arg);
33541 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33542 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33543 this_arg_conv.is_owned = false;
33544 LDKThirtyTwoBytes payment_preimage_ref;
33545 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
33546 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
33547 LDKRecipientOnionFields recipient_onion_conv;
33548 recipient_onion_conv.inner = untag_ptr(recipient_onion);
33549 recipient_onion_conv.is_owned = ptr_is_owned(recipient_onion);
33550 CHECK_INNER_FIELD_ACCESS_OR_NULL(recipient_onion_conv);
33551 recipient_onion_conv = RecipientOnionFields_clone(&recipient_onion_conv);
33552 LDKThirtyTwoBytes payment_id_ref;
33553 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
33554 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
33555 LDKRouteParameters route_params_conv;
33556 route_params_conv.inner = untag_ptr(route_params);
33557 route_params_conv.is_owned = ptr_is_owned(route_params);
33558 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
33559 route_params_conv = RouteParameters_clone(&route_params_conv);
33560 void* retry_strategy_ptr = untag_ptr(retry_strategy);
33561 CHECK_ACCESS(retry_strategy_ptr);
33562 LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr);
33563 retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy));
33564 LDKCResult_PaymentHashRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashRetryableSendFailureZ), "LDKCResult_PaymentHashRetryableSendFailureZ");
33565 *ret_conv = ChannelManager_send_spontaneous_payment_with_retry(&this_arg_conv, payment_preimage_ref, recipient_onion_conv, payment_id_ref, route_params_conv, retry_strategy_conv);
33566 return tag_ptr(ret_conv, true);
33569 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1probe(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path) {
33570 LDKChannelManager this_arg_conv;
33571 this_arg_conv.inner = untag_ptr(this_arg);
33572 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33573 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33574 this_arg_conv.is_owned = false;
33576 path_conv.inner = untag_ptr(path);
33577 path_conv.is_owned = ptr_is_owned(path);
33578 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv);
33579 path_conv = Path_clone(&path_conv);
33580 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
33581 *ret_conv = ChannelManager_send_probe(&this_arg_conv, path_conv);
33582 return tag_ptr(ret_conv, true);
33585 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) {
33586 LDKChannelManager this_arg_conv;
33587 this_arg_conv.inner = untag_ptr(this_arg);
33588 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33589 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33590 this_arg_conv.is_owned = false;
33591 uint8_t temporary_channel_id_arr[32];
33592 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
33593 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
33594 uint8_t (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
33595 LDKPublicKey counterparty_node_id_ref;
33596 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
33597 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
33598 LDKTransaction funding_transaction_ref;
33599 funding_transaction_ref.datalen = (*env)->GetArrayLength(env, funding_transaction);
33600 funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes");
33601 (*env)->GetByteArrayRegion(env, funding_transaction, 0, funding_transaction_ref.datalen, funding_transaction_ref.data);
33602 funding_transaction_ref.data_is_owned = true;
33603 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33604 *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, funding_transaction_ref);
33605 return tag_ptr(ret_conv, true);
33608 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) {
33609 LDKChannelManager this_arg_conv;
33610 this_arg_conv.inner = untag_ptr(this_arg);
33611 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33612 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33613 this_arg_conv.is_owned = false;
33614 LDKPublicKey counterparty_node_id_ref;
33615 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
33616 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
33617 LDKCVec_ThirtyTwoBytesZ channel_ids_constr;
33618 channel_ids_constr.datalen = (*env)->GetArrayLength(env, channel_ids);
33619 if (channel_ids_constr.datalen > 0)
33620 channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements");
33622 channel_ids_constr.data = NULL;
33623 for (size_t i = 0; i < channel_ids_constr.datalen; i++) {
33624 int8_tArray channel_ids_conv_8 = (*env)->GetObjectArrayElement(env, channel_ids, i);
33625 LDKThirtyTwoBytes channel_ids_conv_8_ref;
33626 CHECK((*env)->GetArrayLength(env, channel_ids_conv_8) == 32);
33627 (*env)->GetByteArrayRegion(env, channel_ids_conv_8, 0, 32, channel_ids_conv_8_ref.data);
33628 channel_ids_constr.data[i] = channel_ids_conv_8_ref;
33630 LDKChannelConfig config_conv;
33631 config_conv.inner = untag_ptr(config);
33632 config_conv.is_owned = ptr_is_owned(config);
33633 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv);
33634 config_conv.is_owned = false;
33635 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33636 *ret_conv = ChannelManager_update_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_conv);
33637 return tag_ptr(ret_conv, true);
33640 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) {
33641 LDKChannelManager this_arg_conv;
33642 this_arg_conv.inner = untag_ptr(this_arg);
33643 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33644 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33645 this_arg_conv.is_owned = false;
33646 LDKThirtyTwoBytes intercept_id_ref;
33647 CHECK((*env)->GetArrayLength(env, intercept_id) == 32);
33648 (*env)->GetByteArrayRegion(env, intercept_id, 0, 32, intercept_id_ref.data);
33649 uint8_t next_hop_channel_id_arr[32];
33650 CHECK((*env)->GetArrayLength(env, next_hop_channel_id) == 32);
33651 (*env)->GetByteArrayRegion(env, next_hop_channel_id, 0, 32, next_hop_channel_id_arr);
33652 uint8_t (*next_hop_channel_id_ref)[32] = &next_hop_channel_id_arr;
33653 LDKPublicKey next_node_id_ref;
33654 CHECK((*env)->GetArrayLength(env, next_node_id) == 33);
33655 (*env)->GetByteArrayRegion(env, next_node_id, 0, 33, next_node_id_ref.compressed_form);
33656 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33657 *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);
33658 return tag_ptr(ret_conv, true);
33661 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) {
33662 LDKChannelManager this_arg_conv;
33663 this_arg_conv.inner = untag_ptr(this_arg);
33664 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33665 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33666 this_arg_conv.is_owned = false;
33667 LDKThirtyTwoBytes intercept_id_ref;
33668 CHECK((*env)->GetArrayLength(env, intercept_id) == 32);
33669 (*env)->GetByteArrayRegion(env, intercept_id, 0, 32, intercept_id_ref.data);
33670 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33671 *ret_conv = ChannelManager_fail_intercepted_htlc(&this_arg_conv, intercept_id_ref);
33672 return tag_ptr(ret_conv, true);
33675 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv *env, jclass clz, int64_t this_arg) {
33676 LDKChannelManager this_arg_conv;
33677 this_arg_conv.inner = untag_ptr(this_arg);
33678 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33679 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33680 this_arg_conv.is_owned = false;
33681 ChannelManager_process_pending_htlc_forwards(&this_arg_conv);
33684 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1tick_1occurred(JNIEnv *env, jclass clz, int64_t this_arg) {
33685 LDKChannelManager this_arg_conv;
33686 this_arg_conv.inner = untag_ptr(this_arg);
33687 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33688 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33689 this_arg_conv.is_owned = false;
33690 ChannelManager_timer_tick_occurred(&this_arg_conv);
33693 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc_1backwards(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash) {
33694 LDKChannelManager this_arg_conv;
33695 this_arg_conv.inner = untag_ptr(this_arg);
33696 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33697 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33698 this_arg_conv.is_owned = false;
33699 uint8_t payment_hash_arr[32];
33700 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
33701 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr);
33702 uint8_t (*payment_hash_ref)[32] = &payment_hash_arr;
33703 ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref);
33706 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) {
33707 LDKChannelManager this_arg_conv;
33708 this_arg_conv.inner = untag_ptr(this_arg);
33709 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33710 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33711 this_arg_conv.is_owned = false;
33712 uint8_t payment_hash_arr[32];
33713 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
33714 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_arr);
33715 uint8_t (*payment_hash_ref)[32] = &payment_hash_arr;
33716 LDKFailureCode failure_code_conv = LDKFailureCode_from_java(env, failure_code);
33717 ChannelManager_fail_htlc_backwards_with_reason(&this_arg_conv, payment_hash_ref, failure_code_conv);
33720 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1funds(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_preimage) {
33721 LDKChannelManager this_arg_conv;
33722 this_arg_conv.inner = untag_ptr(this_arg);
33723 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33724 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33725 this_arg_conv.is_owned = false;
33726 LDKThirtyTwoBytes payment_preimage_ref;
33727 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
33728 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
33729 ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref);
33732 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
33733 LDKChannelManager this_arg_conv;
33734 this_arg_conv.inner = untag_ptr(this_arg);
33735 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33736 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33737 this_arg_conv.is_owned = false;
33738 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
33739 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form);
33743 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) {
33744 LDKChannelManager this_arg_conv;
33745 this_arg_conv.inner = untag_ptr(this_arg);
33746 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33747 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33748 this_arg_conv.is_owned = false;
33749 uint8_t temporary_channel_id_arr[32];
33750 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
33751 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
33752 uint8_t (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
33753 LDKPublicKey counterparty_node_id_ref;
33754 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
33755 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
33756 LDKU128 user_channel_id_ref;
33757 CHECK((*env)->GetArrayLength(env, user_channel_id) == 16);
33758 (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes);
33759 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33760 *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id_ref);
33761 return tag_ptr(ret_conv, true);
33764 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) {
33765 LDKChannelManager this_arg_conv;
33766 this_arg_conv.inner = untag_ptr(this_arg);
33767 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33768 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33769 this_arg_conv.is_owned = false;
33770 uint8_t temporary_channel_id_arr[32];
33771 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
33772 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
33773 uint8_t (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
33774 LDKPublicKey counterparty_node_id_ref;
33775 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
33776 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
33777 LDKU128 user_channel_id_ref;
33778 CHECK((*env)->GetArrayLength(env, user_channel_id) == 16);
33779 (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes);
33780 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
33781 *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);
33782 return tag_ptr(ret_conv, true);
33785 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) {
33786 LDKChannelManager this_arg_conv;
33787 this_arg_conv.inner = untag_ptr(this_arg);
33788 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33789 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33790 this_arg_conv.is_owned = false;
33791 void* min_value_msat_ptr = untag_ptr(min_value_msat);
33792 CHECK_ACCESS(min_value_msat_ptr);
33793 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
33794 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
33795 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
33796 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
33797 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
33798 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
33799 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
33800 *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv);
33801 return tag_ptr(ret_conv, true);
33804 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) {
33805 LDKChannelManager this_arg_conv;
33806 this_arg_conv.inner = untag_ptr(this_arg);
33807 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33808 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33809 this_arg_conv.is_owned = false;
33810 void* min_value_msat_ptr = untag_ptr(min_value_msat);
33811 CHECK_ACCESS(min_value_msat_ptr);
33812 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
33813 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
33814 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
33815 *ret_conv = ChannelManager_create_inbound_payment_legacy(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
33816 return tag_ptr(ret_conv, true);
33819 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) {
33820 LDKChannelManager this_arg_conv;
33821 this_arg_conv.inner = untag_ptr(this_arg);
33822 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33823 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33824 this_arg_conv.is_owned = false;
33825 LDKThirtyTwoBytes payment_hash_ref;
33826 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
33827 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
33828 void* min_value_msat_ptr = untag_ptr(min_value_msat);
33829 CHECK_ACCESS(min_value_msat_ptr);
33830 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
33831 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
33832 void* min_final_cltv_expiry_ptr = untag_ptr(min_final_cltv_expiry);
33833 CHECK_ACCESS(min_final_cltv_expiry_ptr);
33834 LDKCOption_u16Z min_final_cltv_expiry_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_ptr);
33835 min_final_cltv_expiry_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry));
33836 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
33837 *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);
33838 return tag_ptr(ret_conv, true);
33841 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) {
33842 LDKChannelManager this_arg_conv;
33843 this_arg_conv.inner = untag_ptr(this_arg);
33844 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33845 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33846 this_arg_conv.is_owned = false;
33847 LDKThirtyTwoBytes payment_hash_ref;
33848 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
33849 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
33850 void* min_value_msat_ptr = untag_ptr(min_value_msat);
33851 CHECK_ACCESS(min_value_msat_ptr);
33852 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
33853 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
33854 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
33855 *ret_conv = ChannelManager_create_inbound_payment_for_hash_legacy(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
33856 return tag_ptr(ret_conv, true);
33859 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) {
33860 LDKChannelManager this_arg_conv;
33861 this_arg_conv.inner = untag_ptr(this_arg);
33862 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33863 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33864 this_arg_conv.is_owned = false;
33865 LDKThirtyTwoBytes payment_hash_ref;
33866 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
33867 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
33868 LDKThirtyTwoBytes payment_secret_ref;
33869 CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
33870 (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
33871 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
33872 *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref);
33873 return tag_ptr(ret_conv, true);
33876 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phantom_1scid(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 int64_t ret_conv = ChannelManager_get_phantom_scid(&this_arg_conv);
33886 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phantom_1route_1hints(JNIEnv *env, jclass clz, int64_t this_arg) {
33887 LDKChannelManager this_arg_conv;
33888 this_arg_conv.inner = untag_ptr(this_arg);
33889 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33890 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33891 this_arg_conv.is_owned = false;
33892 LDKPhantomRouteHints ret_var = ChannelManager_get_phantom_route_hints(&this_arg_conv);
33893 int64_t ret_ref = 0;
33894 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33895 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33899 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1intercept_1scid(JNIEnv *env, jclass clz, int64_t this_arg) {
33900 LDKChannelManager this_arg_conv;
33901 this_arg_conv.inner = untag_ptr(this_arg);
33902 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33903 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33904 this_arg_conv.is_owned = false;
33905 int64_t ret_conv = ChannelManager_get_intercept_scid(&this_arg_conv);
33909 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1compute_1inflight_1htlcs(JNIEnv *env, jclass clz, int64_t this_arg) {
33910 LDKChannelManager this_arg_conv;
33911 this_arg_conv.inner = untag_ptr(this_arg);
33912 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33913 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33914 this_arg_conv.is_owned = false;
33915 LDKInFlightHtlcs ret_var = ChannelManager_compute_inflight_htlcs(&this_arg_conv);
33916 int64_t ret_ref = 0;
33917 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33918 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33922 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
33923 LDKChannelManager this_arg_conv;
33924 this_arg_conv.inner = untag_ptr(this_arg);
33925 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33926 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33927 this_arg_conv.is_owned = false;
33928 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
33929 *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv);
33930 return tag_ptr(ret_ret, true);
33933 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
33934 LDKChannelManager this_arg_conv;
33935 this_arg_conv.inner = untag_ptr(this_arg);
33936 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33937 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33938 this_arg_conv.is_owned = false;
33939 LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
33940 *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv);
33941 return tag_ptr(ret_ret, true);
33944 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Listen(JNIEnv *env, jclass clz, int64_t this_arg) {
33945 LDKChannelManager this_arg_conv;
33946 this_arg_conv.inner = untag_ptr(this_arg);
33947 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33948 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33949 this_arg_conv.is_owned = false;
33950 LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
33951 *ret_ret = ChannelManager_as_Listen(&this_arg_conv);
33952 return tag_ptr(ret_ret, true);
33955 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Confirm(JNIEnv *env, jclass clz, int64_t this_arg) {
33956 LDKChannelManager this_arg_conv;
33957 this_arg_conv.inner = untag_ptr(this_arg);
33958 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33959 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33960 this_arg_conv.is_owned = false;
33961 LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
33962 *ret_ret = ChannelManager_as_Confirm(&this_arg_conv);
33963 return tag_ptr(ret_ret, true);
33966 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1persistable_1update_1future(JNIEnv *env, jclass clz, int64_t this_arg) {
33967 LDKChannelManager this_arg_conv;
33968 this_arg_conv.inner = untag_ptr(this_arg);
33969 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33970 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33971 this_arg_conv.is_owned = false;
33972 LDKFuture ret_var = ChannelManager_get_persistable_update_future(&this_arg_conv);
33973 int64_t ret_ref = 0;
33974 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33975 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33979 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1current_1best_1block(JNIEnv *env, jclass clz, int64_t this_arg) {
33980 LDKChannelManager this_arg_conv;
33981 this_arg_conv.inner = untag_ptr(this_arg);
33982 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33983 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33984 this_arg_conv.is_owned = false;
33985 LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv);
33986 int64_t ret_ref = 0;
33987 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33988 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33992 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1node_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
33993 LDKChannelManager this_arg_conv;
33994 this_arg_conv.inner = untag_ptr(this_arg);
33995 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33996 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33997 this_arg_conv.is_owned = false;
33998 LDKNodeFeatures ret_var = ChannelManager_node_features(&this_arg_conv);
33999 int64_t ret_ref = 0;
34000 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34001 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34005 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1channel_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
34006 LDKChannelManager this_arg_conv;
34007 this_arg_conv.inner = untag_ptr(this_arg);
34008 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34009 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34010 this_arg_conv.is_owned = false;
34011 LDKChannelFeatures ret_var = ChannelManager_channel_features(&this_arg_conv);
34012 int64_t ret_ref = 0;
34013 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34014 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34018 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1channel_1type_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
34019 LDKChannelManager this_arg_conv;
34020 this_arg_conv.inner = untag_ptr(this_arg);
34021 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34022 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34023 this_arg_conv.is_owned = false;
34024 LDKChannelTypeFeatures ret_var = ChannelManager_channel_type_features(&this_arg_conv);
34025 int64_t ret_ref = 0;
34026 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34027 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34031 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1init_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
34032 LDKChannelManager this_arg_conv;
34033 this_arg_conv.inner = untag_ptr(this_arg);
34034 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34035 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34036 this_arg_conv.is_owned = false;
34037 LDKInitFeatures ret_var = ChannelManager_init_features(&this_arg_conv);
34038 int64_t ret_ref = 0;
34039 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34040 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34044 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
34045 LDKChannelManager this_arg_conv;
34046 this_arg_conv.inner = untag_ptr(this_arg);
34047 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34048 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34049 this_arg_conv.is_owned = false;
34050 LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
34051 *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv);
34052 return tag_ptr(ret_ret, true);
34055 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_provided_1init_1features(JNIEnv *env, jclass clz, int64_t _config) {
34056 LDKUserConfig _config_conv;
34057 _config_conv.inner = untag_ptr(_config);
34058 _config_conv.is_owned = ptr_is_owned(_config);
34059 CHECK_INNER_FIELD_ACCESS_OR_NULL(_config_conv);
34060 _config_conv.is_owned = false;
34061 LDKInitFeatures ret_var = provided_init_features(&_config_conv);
34062 int64_t ret_ref = 0;
34063 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34064 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34068 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
34069 LDKCounterpartyForwardingInfo obj_conv;
34070 obj_conv.inner = untag_ptr(obj);
34071 obj_conv.is_owned = ptr_is_owned(obj);
34072 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34073 obj_conv.is_owned = false;
34074 LDKCVec_u8Z ret_var = CounterpartyForwardingInfo_write(&obj_conv);
34075 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
34076 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
34077 CVec_u8Z_free(ret_var);
34081 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
34082 LDKu8slice ser_ref;
34083 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
34084 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
34085 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
34086 *ret_conv = CounterpartyForwardingInfo_read(ser_ref);
34087 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
34088 return tag_ptr(ret_conv, true);
34091 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1write(JNIEnv *env, jclass clz, int64_t obj) {
34092 LDKChannelCounterparty obj_conv;
34093 obj_conv.inner = untag_ptr(obj);
34094 obj_conv.is_owned = ptr_is_owned(obj);
34095 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34096 obj_conv.is_owned = false;
34097 LDKCVec_u8Z ret_var = ChannelCounterparty_write(&obj_conv);
34098 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
34099 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
34100 CVec_u8Z_free(ret_var);
34104 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelCounterparty_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
34105 LDKu8slice ser_ref;
34106 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
34107 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
34108 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
34109 *ret_conv = ChannelCounterparty_read(ser_ref);
34110 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
34111 return tag_ptr(ret_conv, true);
34114 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1write(JNIEnv *env, jclass clz, int64_t obj) {
34115 LDKChannelDetails obj_conv;
34116 obj_conv.inner = untag_ptr(obj);
34117 obj_conv.is_owned = ptr_is_owned(obj);
34118 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34119 obj_conv.is_owned = false;
34120 LDKCVec_u8Z ret_var = ChannelDetails_write(&obj_conv);
34121 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
34122 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
34123 CVec_u8Z_free(ret_var);
34127 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
34128 LDKu8slice ser_ref;
34129 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
34130 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
34131 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
34132 *ret_conv = ChannelDetails_read(ser_ref);
34133 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
34134 return tag_ptr(ret_conv, true);
34137 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1write(JNIEnv *env, jclass clz, int64_t obj) {
34138 LDKPhantomRouteHints obj_conv;
34139 obj_conv.inner = untag_ptr(obj);
34140 obj_conv.is_owned = ptr_is_owned(obj);
34141 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34142 obj_conv.is_owned = false;
34143 LDKCVec_u8Z ret_var = PhantomRouteHints_write(&obj_conv);
34144 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
34145 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
34146 CVec_u8Z_free(ret_var);
34150 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PhantomRouteHints_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
34151 LDKu8slice ser_ref;
34152 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
34153 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
34154 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
34155 *ret_conv = PhantomRouteHints_read(ser_ref);
34156 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
34157 return tag_ptr(ret_conv, true);
34160 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1write(JNIEnv *env, jclass clz, int64_t obj) {
34161 LDKChannelManager obj_conv;
34162 obj_conv.inner = untag_ptr(obj);
34163 obj_conv.is_owned = ptr_is_owned(obj);
34164 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34165 obj_conv.is_owned = false;
34166 LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv);
34167 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
34168 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
34169 CVec_u8Z_free(ret_var);
34173 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34174 LDKChannelManagerReadArgs this_obj_conv;
34175 this_obj_conv.inner = untag_ptr(this_obj);
34176 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34177 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34178 ChannelManagerReadArgs_free(this_obj_conv);
34181 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1entropy_1source(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_entropy_source(&this_ptr_conv), false);
34192 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1entropy_1source(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 LDKEntropySource val_conv = *(LDKEntropySource*)(val_ptr);
34201 if (val_conv.free == LDKEntropySource_JCalls_free) {
34202 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34203 LDKEntropySource_JCalls_cloned(&val_conv);
34205 ChannelManagerReadArgs_set_entropy_source(&this_ptr_conv, val_conv);
34208 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1node_1signer(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_node_signer(&this_ptr_conv), false);
34219 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1node_1signer(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 LDKNodeSigner val_conv = *(LDKNodeSigner*)(val_ptr);
34228 if (val_conv.free == LDKNodeSigner_JCalls_free) {
34229 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34230 LDKNodeSigner_JCalls_cloned(&val_conv);
34232 ChannelManagerReadArgs_set_node_signer(&this_ptr_conv, val_conv);
34235 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1signer_1provider(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_signer_provider(&this_ptr_conv), false);
34246 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1signer_1provider(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 LDKSignerProvider val_conv = *(LDKSignerProvider*)(val_ptr);
34255 if (val_conv.free == LDKSignerProvider_JCalls_free) {
34256 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34257 LDKSignerProvider_JCalls_cloned(&val_conv);
34259 ChannelManagerReadArgs_set_signer_provider(&this_ptr_conv, val_conv);
34262 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(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_fee_estimator(&this_ptr_conv), false);
34273 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(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 LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr);
34282 if (val_conv.free == LDKFeeEstimator_JCalls_free) {
34283 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34284 LDKFeeEstimator_JCalls_cloned(&val_conv);
34286 ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv);
34289 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1chain_1monitor(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_chain_monitor(&this_ptr_conv), false);
34300 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1chain_1monitor(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 LDKWatch val_conv = *(LDKWatch*)(val_ptr);
34309 if (val_conv.free == LDKWatch_JCalls_free) {
34310 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34311 LDKWatch_JCalls_cloned(&val_conv);
34313 ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv);
34316 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(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 // WARNING: This object doesn't live past this scope, needs clone!
34323 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv), false);
34327 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34328 LDKChannelManagerReadArgs this_ptr_conv;
34329 this_ptr_conv.inner = untag_ptr(this_ptr);
34330 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34331 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34332 this_ptr_conv.is_owned = false;
34333 void* val_ptr = untag_ptr(val);
34334 CHECK_ACCESS(val_ptr);
34335 LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr);
34336 if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
34337 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34338 LDKBroadcasterInterface_JCalls_cloned(&val_conv);
34340 ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv);
34343 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1router(JNIEnv *env, jclass clz, int64_t this_ptr) {
34344 LDKChannelManagerReadArgs this_ptr_conv;
34345 this_ptr_conv.inner = untag_ptr(this_ptr);
34346 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34347 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34348 this_ptr_conv.is_owned = false;
34349 // WARNING: This object doesn't live past this scope, needs clone!
34350 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_router(&this_ptr_conv), false);
34354 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1router(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34355 LDKChannelManagerReadArgs this_ptr_conv;
34356 this_ptr_conv.inner = untag_ptr(this_ptr);
34357 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34358 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34359 this_ptr_conv.is_owned = false;
34360 void* val_ptr = untag_ptr(val);
34361 CHECK_ACCESS(val_ptr);
34362 LDKRouter val_conv = *(LDKRouter*)(val_ptr);
34363 if (val_conv.free == LDKRouter_JCalls_free) {
34364 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34365 LDKRouter_JCalls_cloned(&val_conv);
34367 ChannelManagerReadArgs_set_router(&this_ptr_conv, val_conv);
34370 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv *env, jclass clz, int64_t this_ptr) {
34371 LDKChannelManagerReadArgs this_ptr_conv;
34372 this_ptr_conv.inner = untag_ptr(this_ptr);
34373 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34374 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34375 this_ptr_conv.is_owned = false;
34376 // WARNING: This object doesn't live past this scope, needs clone!
34377 int64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_logger(&this_ptr_conv), false);
34381 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34382 LDKChannelManagerReadArgs this_ptr_conv;
34383 this_ptr_conv.inner = untag_ptr(this_ptr);
34384 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34385 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34386 this_ptr_conv.is_owned = false;
34387 void* val_ptr = untag_ptr(val);
34388 CHECK_ACCESS(val_ptr);
34389 LDKLogger val_conv = *(LDKLogger*)(val_ptr);
34390 if (val_conv.free == LDKLogger_JCalls_free) {
34391 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34392 LDKLogger_JCalls_cloned(&val_conv);
34394 ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv);
34397 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv *env, jclass clz, int64_t this_ptr) {
34398 LDKChannelManagerReadArgs this_ptr_conv;
34399 this_ptr_conv.inner = untag_ptr(this_ptr);
34400 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34401 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34402 this_ptr_conv.is_owned = false;
34403 LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv);
34404 int64_t ret_ref = 0;
34405 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34406 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34410 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34411 LDKChannelManagerReadArgs this_ptr_conv;
34412 this_ptr_conv.inner = untag_ptr(this_ptr);
34413 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34414 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34415 this_ptr_conv.is_owned = false;
34416 LDKUserConfig val_conv;
34417 val_conv.inner = untag_ptr(val);
34418 val_conv.is_owned = ptr_is_owned(val);
34419 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34420 val_conv = UserConfig_clone(&val_conv);
34421 ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv);
34424 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) {
34425 void* entropy_source_ptr = untag_ptr(entropy_source);
34426 CHECK_ACCESS(entropy_source_ptr);
34427 LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr);
34428 if (entropy_source_conv.free == LDKEntropySource_JCalls_free) {
34429 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34430 LDKEntropySource_JCalls_cloned(&entropy_source_conv);
34432 void* node_signer_ptr = untag_ptr(node_signer);
34433 CHECK_ACCESS(node_signer_ptr);
34434 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
34435 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
34436 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34437 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
34439 void* signer_provider_ptr = untag_ptr(signer_provider);
34440 CHECK_ACCESS(signer_provider_ptr);
34441 LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr);
34442 if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) {
34443 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34444 LDKSignerProvider_JCalls_cloned(&signer_provider_conv);
34446 void* fee_estimator_ptr = untag_ptr(fee_estimator);
34447 CHECK_ACCESS(fee_estimator_ptr);
34448 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
34449 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
34450 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34451 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
34453 void* chain_monitor_ptr = untag_ptr(chain_monitor);
34454 CHECK_ACCESS(chain_monitor_ptr);
34455 LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
34456 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
34457 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34458 LDKWatch_JCalls_cloned(&chain_monitor_conv);
34460 void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster);
34461 CHECK_ACCESS(tx_broadcaster_ptr);
34462 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
34463 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
34464 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34465 LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
34467 void* router_ptr = untag_ptr(router);
34468 CHECK_ACCESS(router_ptr);
34469 LDKRouter router_conv = *(LDKRouter*)(router_ptr);
34470 if (router_conv.free == LDKRouter_JCalls_free) {
34471 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34472 LDKRouter_JCalls_cloned(&router_conv);
34474 void* logger_ptr = untag_ptr(logger);
34475 CHECK_ACCESS(logger_ptr);
34476 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
34477 if (logger_conv.free == LDKLogger_JCalls_free) {
34478 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
34479 LDKLogger_JCalls_cloned(&logger_conv);
34481 LDKUserConfig default_config_conv;
34482 default_config_conv.inner = untag_ptr(default_config);
34483 default_config_conv.is_owned = ptr_is_owned(default_config);
34484 CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv);
34485 default_config_conv = UserConfig_clone(&default_config_conv);
34486 LDKCVec_ChannelMonitorZ channel_monitors_constr;
34487 channel_monitors_constr.datalen = (*env)->GetArrayLength(env, channel_monitors);
34488 if (channel_monitors_constr.datalen > 0)
34489 channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
34491 channel_monitors_constr.data = NULL;
34492 int64_t* channel_monitors_vals = (*env)->GetLongArrayElements (env, channel_monitors, NULL);
34493 for (size_t q = 0; q < channel_monitors_constr.datalen; q++) {
34494 int64_t channel_monitors_conv_16 = channel_monitors_vals[q];
34495 LDKChannelMonitor channel_monitors_conv_16_conv;
34496 channel_monitors_conv_16_conv.inner = untag_ptr(channel_monitors_conv_16);
34497 channel_monitors_conv_16_conv.is_owned = ptr_is_owned(channel_monitors_conv_16);
34498 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv);
34499 channel_monitors_conv_16_conv.is_owned = false;
34500 channel_monitors_constr.data[q] = channel_monitors_conv_16_conv;
34502 (*env)->ReleaseLongArrayElements(env, channel_monitors, channel_monitors_vals, 0);
34503 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);
34504 int64_t ret_ref = 0;
34505 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34506 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34510 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1BlockHashChannelManagerZ_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) {
34511 LDKu8slice ser_ref;
34512 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
34513 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
34514 LDKChannelManagerReadArgs arg_conv;
34515 arg_conv.inner = untag_ptr(arg);
34516 arg_conv.is_owned = ptr_is_owned(arg);
34517 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34518 // WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs
34520 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
34521 *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv);
34522 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
34523 return tag_ptr(ret_conv, true);
34526 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34527 LDKExpandedKey this_obj_conv;
34528 this_obj_conv.inner = untag_ptr(this_obj);
34529 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34530 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34531 ExpandedKey_free(this_obj_conv);
34534 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpandedKey_1new(JNIEnv *env, jclass clz, int8_tArray key_material) {
34535 uint8_t key_material_arr[32];
34536 CHECK((*env)->GetArrayLength(env, key_material) == 32);
34537 (*env)->GetByteArrayRegion(env, key_material, 0, 32, key_material_arr);
34538 uint8_t (*key_material_ref)[32] = &key_material_arr;
34539 LDKExpandedKey ret_var = ExpandedKey_new(key_material_ref);
34540 int64_t ret_ref = 0;
34541 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34542 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34546 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) {
34547 LDKExpandedKey keys_conv;
34548 keys_conv.inner = untag_ptr(keys);
34549 keys_conv.is_owned = ptr_is_owned(keys);
34550 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
34551 keys_conv.is_owned = false;
34552 void* min_value_msat_ptr = untag_ptr(min_value_msat);
34553 CHECK_ACCESS(min_value_msat_ptr);
34554 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
34555 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
34556 void* entropy_source_ptr = untag_ptr(entropy_source);
34557 if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); }
34558 LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr;
34559 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
34560 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
34561 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
34562 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
34563 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
34564 *ret_conv = create(&keys_conv, min_value_msat_conv, invoice_expiry_delta_secs, entropy_source_conv, current_time, min_final_cltv_expiry_delta_conv);
34565 return tag_ptr(ret_conv, true);
34568 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) {
34569 LDKExpandedKey keys_conv;
34570 keys_conv.inner = untag_ptr(keys);
34571 keys_conv.is_owned = ptr_is_owned(keys);
34572 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
34573 keys_conv.is_owned = false;
34574 void* min_value_msat_ptr = untag_ptr(min_value_msat);
34575 CHECK_ACCESS(min_value_msat_ptr);
34576 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
34577 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
34578 LDKThirtyTwoBytes payment_hash_ref;
34579 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
34580 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
34581 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
34582 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
34583 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
34584 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
34585 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
34586 *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);
34587 return tag_ptr(ret_conv, true);
34590 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
34591 if (!ptr_is_owned(this_ptr)) return;
34592 void* this_ptr_ptr = untag_ptr(this_ptr);
34593 CHECK_ACCESS(this_ptr_ptr);
34594 LDKDecodeError this_ptr_conv = *(LDKDecodeError*)(this_ptr_ptr);
34595 FREE(untag_ptr(this_ptr));
34596 DecodeError_free(this_ptr_conv);
34599 static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) {
34600 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
34601 *ret_copy = DecodeError_clone(arg);
34602 int64_t ret_ref = tag_ptr(ret_copy, true);
34605 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34606 LDKDecodeError* arg_conv = (LDKDecodeError*)untag_ptr(arg);
34607 int64_t ret_conv = DecodeError_clone_ptr(arg_conv);
34611 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34612 LDKDecodeError* orig_conv = (LDKDecodeError*)untag_ptr(orig);
34613 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
34614 *ret_copy = DecodeError_clone(orig_conv);
34615 int64_t ret_ref = tag_ptr(ret_copy, true);
34619 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1unknown_1version(JNIEnv *env, jclass clz) {
34620 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
34621 *ret_copy = DecodeError_unknown_version();
34622 int64_t ret_ref = tag_ptr(ret_copy, true);
34626 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1unknown_1required_1feature(JNIEnv *env, jclass clz) {
34627 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
34628 *ret_copy = DecodeError_unknown_required_feature();
34629 int64_t ret_ref = tag_ptr(ret_copy, true);
34633 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1invalid_1value(JNIEnv *env, jclass clz) {
34634 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
34635 *ret_copy = DecodeError_invalid_value();
34636 int64_t ret_ref = tag_ptr(ret_copy, true);
34640 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1short_1read(JNIEnv *env, jclass clz) {
34641 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
34642 *ret_copy = DecodeError_short_read();
34643 int64_t ret_ref = tag_ptr(ret_copy, true);
34647 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1bad_1length_1descriptor(JNIEnv *env, jclass clz) {
34648 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
34649 *ret_copy = DecodeError_bad_length_descriptor();
34650 int64_t ret_ref = tag_ptr(ret_copy, true);
34654 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1io(JNIEnv *env, jclass clz, jclass a) {
34655 LDKIOError a_conv = LDKIOError_from_java(env, a);
34656 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
34657 *ret_copy = DecodeError_io(a_conv);
34658 int64_t ret_ref = tag_ptr(ret_copy, true);
34662 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1unsupported_1compression(JNIEnv *env, jclass clz) {
34663 LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
34664 *ret_copy = DecodeError_unsupported_compression();
34665 int64_t ret_ref = tag_ptr(ret_copy, true);
34669 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DecodeError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
34670 LDKDecodeError* a_conv = (LDKDecodeError*)untag_ptr(a);
34671 LDKDecodeError* b_conv = (LDKDecodeError*)untag_ptr(b);
34672 jboolean ret_conv = DecodeError_eq(a_conv, b_conv);
34676 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34677 LDKInit this_obj_conv;
34678 this_obj_conv.inner = untag_ptr(this_obj);
34679 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34680 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34681 Init_free(this_obj_conv);
34684 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
34685 LDKInit this_ptr_conv;
34686 this_ptr_conv.inner = untag_ptr(this_ptr);
34687 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34688 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34689 this_ptr_conv.is_owned = false;
34690 LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv);
34691 int64_t ret_ref = 0;
34692 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34693 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34697 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34698 LDKInit this_ptr_conv;
34699 this_ptr_conv.inner = untag_ptr(this_ptr);
34700 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34701 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34702 this_ptr_conv.is_owned = false;
34703 LDKInitFeatures val_conv;
34704 val_conv.inner = untag_ptr(val);
34705 val_conv.is_owned = ptr_is_owned(val);
34706 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34707 val_conv = InitFeatures_clone(&val_conv);
34708 Init_set_features(&this_ptr_conv, val_conv);
34711 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1get_1remote_1network_1address(JNIEnv *env, jclass clz, int64_t this_ptr) {
34712 LDKInit this_ptr_conv;
34713 this_ptr_conv.inner = untag_ptr(this_ptr);
34714 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34715 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34716 this_ptr_conv.is_owned = false;
34717 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
34718 *ret_copy = Init_get_remote_network_address(&this_ptr_conv);
34719 int64_t ret_ref = tag_ptr(ret_copy, true);
34723 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1set_1remote_1network_1address(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
34724 LDKInit this_ptr_conv;
34725 this_ptr_conv.inner = untag_ptr(this_ptr);
34726 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34727 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34728 this_ptr_conv.is_owned = false;
34729 void* val_ptr = untag_ptr(val);
34730 CHECK_ACCESS(val_ptr);
34731 LDKCOption_NetAddressZ val_conv = *(LDKCOption_NetAddressZ*)(val_ptr);
34732 val_conv = COption_NetAddressZ_clone((LDKCOption_NetAddressZ*)untag_ptr(val));
34733 Init_set_remote_network_address(&this_ptr_conv, val_conv);
34736 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) {
34737 LDKInitFeatures features_arg_conv;
34738 features_arg_conv.inner = untag_ptr(features_arg);
34739 features_arg_conv.is_owned = ptr_is_owned(features_arg);
34740 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
34741 features_arg_conv = InitFeatures_clone(&features_arg_conv);
34742 void* remote_network_address_arg_ptr = untag_ptr(remote_network_address_arg);
34743 CHECK_ACCESS(remote_network_address_arg_ptr);
34744 LDKCOption_NetAddressZ remote_network_address_arg_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_arg_ptr);
34745 LDKInit ret_var = Init_new(features_arg_conv, remote_network_address_arg_conv);
34746 int64_t ret_ref = 0;
34747 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34748 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34752 static inline uint64_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) {
34753 LDKInit ret_var = Init_clone(arg);
34754 int64_t ret_ref = 0;
34755 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34756 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34759 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34761 arg_conv.inner = untag_ptr(arg);
34762 arg_conv.is_owned = ptr_is_owned(arg);
34763 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34764 arg_conv.is_owned = false;
34765 int64_t ret_conv = Init_clone_ptr(&arg_conv);
34769 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34771 orig_conv.inner = untag_ptr(orig);
34772 orig_conv.is_owned = ptr_is_owned(orig);
34773 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34774 orig_conv.is_owned = false;
34775 LDKInit ret_var = Init_clone(&orig_conv);
34776 int64_t ret_ref = 0;
34777 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34778 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34782 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Init_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
34784 a_conv.inner = untag_ptr(a);
34785 a_conv.is_owned = ptr_is_owned(a);
34786 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
34787 a_conv.is_owned = false;
34789 b_conv.inner = untag_ptr(b);
34790 b_conv.is_owned = ptr_is_owned(b);
34791 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
34792 b_conv.is_owned = false;
34793 jboolean ret_conv = Init_eq(&a_conv, &b_conv);
34797 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34798 LDKErrorMessage this_obj_conv;
34799 this_obj_conv.inner = untag_ptr(this_obj);
34800 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34801 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34802 ErrorMessage_free(this_obj_conv);
34805 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
34806 LDKErrorMessage this_ptr_conv;
34807 this_ptr_conv.inner = untag_ptr(this_ptr);
34808 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34809 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34810 this_ptr_conv.is_owned = false;
34811 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
34812 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(&this_ptr_conv));
34816 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34817 LDKErrorMessage this_ptr_conv;
34818 this_ptr_conv.inner = untag_ptr(this_ptr);
34819 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34820 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34821 this_ptr_conv.is_owned = false;
34822 LDKThirtyTwoBytes val_ref;
34823 CHECK((*env)->GetArrayLength(env, val) == 32);
34824 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
34825 ErrorMessage_set_channel_id(&this_ptr_conv, val_ref);
34828 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) {
34829 LDKErrorMessage this_ptr_conv;
34830 this_ptr_conv.inner = untag_ptr(this_ptr);
34831 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34832 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34833 this_ptr_conv.is_owned = false;
34834 LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv);
34835 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
34840 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
34841 LDKErrorMessage this_ptr_conv;
34842 this_ptr_conv.inner = untag_ptr(this_ptr);
34843 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34845 this_ptr_conv.is_owned = false;
34846 LDKStr val_conv = java_to_owned_str(env, val);
34847 ErrorMessage_set_data(&this_ptr_conv, val_conv);
34850 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, jstring data_arg) {
34851 LDKThirtyTwoBytes channel_id_arg_ref;
34852 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
34853 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
34854 LDKStr data_arg_conv = java_to_owned_str(env, data_arg);
34855 LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_arg_conv);
34856 int64_t ret_ref = 0;
34857 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34858 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34862 static inline uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) {
34863 LDKErrorMessage ret_var = ErrorMessage_clone(arg);
34864 int64_t ret_ref = 0;
34865 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34866 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34869 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34870 LDKErrorMessage arg_conv;
34871 arg_conv.inner = untag_ptr(arg);
34872 arg_conv.is_owned = ptr_is_owned(arg);
34873 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34874 arg_conv.is_owned = false;
34875 int64_t ret_conv = ErrorMessage_clone_ptr(&arg_conv);
34879 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34880 LDKErrorMessage orig_conv;
34881 orig_conv.inner = untag_ptr(orig);
34882 orig_conv.is_owned = ptr_is_owned(orig);
34883 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34884 orig_conv.is_owned = false;
34885 LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv);
34886 int64_t ret_ref = 0;
34887 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34888 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34892 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
34893 LDKErrorMessage a_conv;
34894 a_conv.inner = untag_ptr(a);
34895 a_conv.is_owned = ptr_is_owned(a);
34896 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
34897 a_conv.is_owned = false;
34898 LDKErrorMessage b_conv;
34899 b_conv.inner = untag_ptr(b);
34900 b_conv.is_owned = ptr_is_owned(b);
34901 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
34902 b_conv.is_owned = false;
34903 jboolean ret_conv = ErrorMessage_eq(&a_conv, &b_conv);
34907 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
34908 LDKWarningMessage this_obj_conv;
34909 this_obj_conv.inner = untag_ptr(this_obj);
34910 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34911 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34912 WarningMessage_free(this_obj_conv);
34915 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WarningMessage_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
34916 LDKWarningMessage this_ptr_conv;
34917 this_ptr_conv.inner = untag_ptr(this_ptr);
34918 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34919 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34920 this_ptr_conv.is_owned = false;
34921 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
34922 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *WarningMessage_get_channel_id(&this_ptr_conv));
34926 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
34927 LDKWarningMessage this_ptr_conv;
34928 this_ptr_conv.inner = untag_ptr(this_ptr);
34929 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34930 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34931 this_ptr_conv.is_owned = false;
34932 LDKThirtyTwoBytes val_ref;
34933 CHECK((*env)->GetArrayLength(env, val) == 32);
34934 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
34935 WarningMessage_set_channel_id(&this_ptr_conv, val_ref);
34938 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_WarningMessage_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) {
34939 LDKWarningMessage this_ptr_conv;
34940 this_ptr_conv.inner = untag_ptr(this_ptr);
34941 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34942 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34943 this_ptr_conv.is_owned = false;
34944 LDKStr ret_str = WarningMessage_get_data(&this_ptr_conv);
34945 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
34950 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
34951 LDKWarningMessage this_ptr_conv;
34952 this_ptr_conv.inner = untag_ptr(this_ptr);
34953 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34954 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34955 this_ptr_conv.is_owned = false;
34956 LDKStr val_conv = java_to_owned_str(env, val);
34957 WarningMessage_set_data(&this_ptr_conv, val_conv);
34960 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, jstring data_arg) {
34961 LDKThirtyTwoBytes channel_id_arg_ref;
34962 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
34963 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
34964 LDKStr data_arg_conv = java_to_owned_str(env, data_arg);
34965 LDKWarningMessage ret_var = WarningMessage_new(channel_id_arg_ref, data_arg_conv);
34966 int64_t ret_ref = 0;
34967 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34968 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34972 static inline uint64_t WarningMessage_clone_ptr(LDKWarningMessage *NONNULL_PTR arg) {
34973 LDKWarningMessage ret_var = WarningMessage_clone(arg);
34974 int64_t ret_ref = 0;
34975 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34976 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34979 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
34980 LDKWarningMessage arg_conv;
34981 arg_conv.inner = untag_ptr(arg);
34982 arg_conv.is_owned = ptr_is_owned(arg);
34983 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34984 arg_conv.is_owned = false;
34985 int64_t ret_conv = WarningMessage_clone_ptr(&arg_conv);
34989 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) {
34990 LDKWarningMessage orig_conv;
34991 orig_conv.inner = untag_ptr(orig);
34992 orig_conv.is_owned = ptr_is_owned(orig);
34993 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34994 orig_conv.is_owned = false;
34995 LDKWarningMessage ret_var = WarningMessage_clone(&orig_conv);
34996 int64_t ret_ref = 0;
34997 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34998 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35002 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_WarningMessage_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
35003 LDKWarningMessage a_conv;
35004 a_conv.inner = untag_ptr(a);
35005 a_conv.is_owned = ptr_is_owned(a);
35006 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35007 a_conv.is_owned = false;
35008 LDKWarningMessage b_conv;
35009 b_conv.inner = untag_ptr(b);
35010 b_conv.is_owned = ptr_is_owned(b);
35011 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35012 b_conv.is_owned = false;
35013 jboolean ret_conv = WarningMessage_eq(&a_conv, &b_conv);
35017 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35018 LDKPing this_obj_conv;
35019 this_obj_conv.inner = untag_ptr(this_obj);
35020 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35021 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35022 Ping_free(this_obj_conv);
35025 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr) {
35026 LDKPing this_ptr_conv;
35027 this_ptr_conv.inner = untag_ptr(this_ptr);
35028 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35029 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35030 this_ptr_conv.is_owned = false;
35031 int16_t ret_conv = Ping_get_ponglen(&this_ptr_conv);
35035 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
35036 LDKPing this_ptr_conv;
35037 this_ptr_conv.inner = untag_ptr(this_ptr);
35038 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35039 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35040 this_ptr_conv.is_owned = false;
35041 Ping_set_ponglen(&this_ptr_conv, val);
35044 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) {
35045 LDKPing this_ptr_conv;
35046 this_ptr_conv.inner = untag_ptr(this_ptr);
35047 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35048 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35049 this_ptr_conv.is_owned = false;
35050 int16_t ret_conv = Ping_get_byteslen(&this_ptr_conv);
35054 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
35055 LDKPing this_ptr_conv;
35056 this_ptr_conv.inner = untag_ptr(this_ptr);
35057 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35058 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35059 this_ptr_conv.is_owned = false;
35060 Ping_set_byteslen(&this_ptr_conv, val);
35063 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jclass clz, int16_t ponglen_arg, int16_t byteslen_arg) {
35064 LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg);
35065 int64_t ret_ref = 0;
35066 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35067 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35071 static inline uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) {
35072 LDKPing ret_var = Ping_clone(arg);
35073 int64_t ret_ref = 0;
35074 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35075 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35078 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35080 arg_conv.inner = untag_ptr(arg);
35081 arg_conv.is_owned = ptr_is_owned(arg);
35082 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35083 arg_conv.is_owned = false;
35084 int64_t ret_conv = Ping_clone_ptr(&arg_conv);
35088 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35090 orig_conv.inner = untag_ptr(orig);
35091 orig_conv.is_owned = ptr_is_owned(orig);
35092 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35093 orig_conv.is_owned = false;
35094 LDKPing ret_var = Ping_clone(&orig_conv);
35095 int64_t ret_ref = 0;
35096 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35097 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35101 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Ping_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
35103 a_conv.inner = untag_ptr(a);
35104 a_conv.is_owned = ptr_is_owned(a);
35105 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35106 a_conv.is_owned = false;
35108 b_conv.inner = untag_ptr(b);
35109 b_conv.is_owned = ptr_is_owned(b);
35110 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35111 b_conv.is_owned = false;
35112 jboolean ret_conv = Ping_eq(&a_conv, &b_conv);
35116 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35117 LDKPong this_obj_conv;
35118 this_obj_conv.inner = untag_ptr(this_obj);
35119 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35120 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35121 Pong_free(this_obj_conv);
35124 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) {
35125 LDKPong this_ptr_conv;
35126 this_ptr_conv.inner = untag_ptr(this_ptr);
35127 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35128 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35129 this_ptr_conv.is_owned = false;
35130 int16_t ret_conv = Pong_get_byteslen(&this_ptr_conv);
35134 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
35135 LDKPong 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 Pong_set_byteslen(&this_ptr_conv, val);
35143 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jclass clz, int16_t byteslen_arg) {
35144 LDKPong ret_var = Pong_new(byteslen_arg);
35145 int64_t ret_ref = 0;
35146 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35147 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35151 static inline uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) {
35152 LDKPong ret_var = Pong_clone(arg);
35153 int64_t ret_ref = 0;
35154 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35155 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35158 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35160 arg_conv.inner = untag_ptr(arg);
35161 arg_conv.is_owned = ptr_is_owned(arg);
35162 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35163 arg_conv.is_owned = false;
35164 int64_t ret_conv = Pong_clone_ptr(&arg_conv);
35168 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35170 orig_conv.inner = untag_ptr(orig);
35171 orig_conv.is_owned = ptr_is_owned(orig);
35172 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35173 orig_conv.is_owned = false;
35174 LDKPong ret_var = Pong_clone(&orig_conv);
35175 int64_t ret_ref = 0;
35176 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35177 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35181 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Pong_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
35183 a_conv.inner = untag_ptr(a);
35184 a_conv.is_owned = ptr_is_owned(a);
35185 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35186 a_conv.is_owned = false;
35188 b_conv.inner = untag_ptr(b);
35189 b_conv.is_owned = ptr_is_owned(b);
35190 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35191 b_conv.is_owned = false;
35192 jboolean ret_conv = Pong_eq(&a_conv, &b_conv);
35196 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35197 LDKOpenChannel this_obj_conv;
35198 this_obj_conv.inner = untag_ptr(this_obj);
35199 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35200 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35201 OpenChannel_free(this_obj_conv);
35204 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
35205 LDKOpenChannel this_ptr_conv;
35206 this_ptr_conv.inner = untag_ptr(this_ptr);
35207 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35208 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35209 this_ptr_conv.is_owned = false;
35210 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35211 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(&this_ptr_conv));
35215 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35216 LDKOpenChannel this_ptr_conv;
35217 this_ptr_conv.inner = untag_ptr(this_ptr);
35218 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35219 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35220 this_ptr_conv.is_owned = false;
35221 LDKThirtyTwoBytes val_ref;
35222 CHECK((*env)->GetArrayLength(env, val) == 32);
35223 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35224 OpenChannel_set_chain_hash(&this_ptr_conv, val_ref);
35227 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
35228 LDKOpenChannel this_ptr_conv;
35229 this_ptr_conv.inner = untag_ptr(this_ptr);
35230 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35231 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35232 this_ptr_conv.is_owned = false;
35233 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35234 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(&this_ptr_conv));
35238 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35239 LDKOpenChannel this_ptr_conv;
35240 this_ptr_conv.inner = untag_ptr(this_ptr);
35241 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35242 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35243 this_ptr_conv.is_owned = false;
35244 LDKThirtyTwoBytes val_ref;
35245 CHECK((*env)->GetArrayLength(env, val) == 32);
35246 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35247 OpenChannel_set_temporary_channel_id(&this_ptr_conv, val_ref);
35250 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
35251 LDKOpenChannel this_ptr_conv;
35252 this_ptr_conv.inner = untag_ptr(this_ptr);
35253 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35254 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35255 this_ptr_conv.is_owned = false;
35256 int64_t ret_conv = OpenChannel_get_funding_satoshis(&this_ptr_conv);
35260 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35261 LDKOpenChannel this_ptr_conv;
35262 this_ptr_conv.inner = untag_ptr(this_ptr);
35263 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35264 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35265 this_ptr_conv.is_owned = false;
35266 OpenChannel_set_funding_satoshis(&this_ptr_conv, val);
35269 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
35270 LDKOpenChannel this_ptr_conv;
35271 this_ptr_conv.inner = untag_ptr(this_ptr);
35272 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35273 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35274 this_ptr_conv.is_owned = false;
35275 int64_t ret_conv = OpenChannel_get_push_msat(&this_ptr_conv);
35279 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35280 LDKOpenChannel this_ptr_conv;
35281 this_ptr_conv.inner = untag_ptr(this_ptr);
35282 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35283 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35284 this_ptr_conv.is_owned = false;
35285 OpenChannel_set_push_msat(&this_ptr_conv, val);
35288 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
35289 LDKOpenChannel this_ptr_conv;
35290 this_ptr_conv.inner = untag_ptr(this_ptr);
35291 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35292 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35293 this_ptr_conv.is_owned = false;
35294 int64_t ret_conv = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv);
35298 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35299 LDKOpenChannel this_ptr_conv;
35300 this_ptr_conv.inner = untag_ptr(this_ptr);
35301 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35302 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35303 this_ptr_conv.is_owned = false;
35304 OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
35307 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) {
35308 LDKOpenChannel this_ptr_conv;
35309 this_ptr_conv.inner = untag_ptr(this_ptr);
35310 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35311 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35312 this_ptr_conv.is_owned = false;
35313 int64_t ret_conv = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
35317 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) {
35318 LDKOpenChannel this_ptr_conv;
35319 this_ptr_conv.inner = untag_ptr(this_ptr);
35320 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35321 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35322 this_ptr_conv.is_owned = false;
35323 OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
35326 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
35327 LDKOpenChannel this_ptr_conv;
35328 this_ptr_conv.inner = untag_ptr(this_ptr);
35329 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35330 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35331 this_ptr_conv.is_owned = false;
35332 int64_t ret_conv = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv);
35336 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35337 LDKOpenChannel this_ptr_conv;
35338 this_ptr_conv.inner = untag_ptr(this_ptr);
35339 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35340 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35341 this_ptr_conv.is_owned = false;
35342 OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
35345 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
35346 LDKOpenChannel this_ptr_conv;
35347 this_ptr_conv.inner = untag_ptr(this_ptr);
35348 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35349 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35350 this_ptr_conv.is_owned = false;
35351 int64_t ret_conv = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv);
35355 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35356 LDKOpenChannel this_ptr_conv;
35357 this_ptr_conv.inner = untag_ptr(this_ptr);
35358 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35359 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35360 this_ptr_conv.is_owned = false;
35361 OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
35364 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) {
35365 LDKOpenChannel this_ptr_conv;
35366 this_ptr_conv.inner = untag_ptr(this_ptr);
35367 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35368 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35369 this_ptr_conv.is_owned = false;
35370 int32_t ret_conv = OpenChannel_get_feerate_per_kw(&this_ptr_conv);
35374 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t 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 OpenChannel_set_feerate_per_kw(&this_ptr_conv, val);
35383 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
35384 LDKOpenChannel this_ptr_conv;
35385 this_ptr_conv.inner = untag_ptr(this_ptr);
35386 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35387 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35388 this_ptr_conv.is_owned = false;
35389 int16_t ret_conv = OpenChannel_get_to_self_delay(&this_ptr_conv);
35393 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
35394 LDKOpenChannel this_ptr_conv;
35395 this_ptr_conv.inner = untag_ptr(this_ptr);
35396 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35397 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35398 this_ptr_conv.is_owned = false;
35399 OpenChannel_set_to_self_delay(&this_ptr_conv, val);
35402 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
35403 LDKOpenChannel this_ptr_conv;
35404 this_ptr_conv.inner = untag_ptr(this_ptr);
35405 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35406 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35407 this_ptr_conv.is_owned = false;
35408 int16_t ret_conv = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv);
35412 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
35413 LDKOpenChannel this_ptr_conv;
35414 this_ptr_conv.inner = untag_ptr(this_ptr);
35415 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35416 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35417 this_ptr_conv.is_owned = false;
35418 OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
35421 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
35422 LDKOpenChannel this_ptr_conv;
35423 this_ptr_conv.inner = untag_ptr(this_ptr);
35424 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35425 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35426 this_ptr_conv.is_owned = false;
35427 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35428 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form);
35432 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
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 LDKPublicKey val_ref;
35439 CHECK((*env)->GetArrayLength(env, val) == 33);
35440 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35441 OpenChannel_set_funding_pubkey(&this_ptr_conv, val_ref);
35444 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
35445 LDKOpenChannel this_ptr_conv;
35446 this_ptr_conv.inner = untag_ptr(this_ptr);
35447 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35448 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35449 this_ptr_conv.is_owned = false;
35450 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35451 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form);
35455 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
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 LDKPublicKey val_ref;
35462 CHECK((*env)->GetArrayLength(env, val) == 33);
35463 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35464 OpenChannel_set_revocation_basepoint(&this_ptr_conv, val_ref);
35467 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
35468 LDKOpenChannel this_ptr_conv;
35469 this_ptr_conv.inner = untag_ptr(this_ptr);
35470 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35471 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35472 this_ptr_conv.is_owned = false;
35473 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35474 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form);
35478 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
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 LDKPublicKey val_ref;
35485 CHECK((*env)->GetArrayLength(env, val) == 33);
35486 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35487 OpenChannel_set_payment_point(&this_ptr_conv, val_ref);
35490 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
35491 LDKOpenChannel this_ptr_conv;
35492 this_ptr_conv.inner = untag_ptr(this_ptr);
35493 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35494 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35495 this_ptr_conv.is_owned = false;
35496 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35497 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
35501 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35502 LDKOpenChannel this_ptr_conv;
35503 this_ptr_conv.inner = untag_ptr(this_ptr);
35504 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35505 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35506 this_ptr_conv.is_owned = false;
35507 LDKPublicKey val_ref;
35508 CHECK((*env)->GetArrayLength(env, val) == 33);
35509 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35510 OpenChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
35513 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
35514 LDKOpenChannel this_ptr_conv;
35515 this_ptr_conv.inner = untag_ptr(this_ptr);
35516 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35517 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35518 this_ptr_conv.is_owned = false;
35519 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35520 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form);
35524 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35525 LDKOpenChannel this_ptr_conv;
35526 this_ptr_conv.inner = untag_ptr(this_ptr);
35527 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35528 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35529 this_ptr_conv.is_owned = false;
35530 LDKPublicKey val_ref;
35531 CHECK((*env)->GetArrayLength(env, val) == 33);
35532 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35533 OpenChannel_set_htlc_basepoint(&this_ptr_conv, val_ref);
35536 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
35537 LDKOpenChannel this_ptr_conv;
35538 this_ptr_conv.inner = untag_ptr(this_ptr);
35539 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35540 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35541 this_ptr_conv.is_owned = false;
35542 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35543 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form);
35547 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) {
35548 LDKOpenChannel this_ptr_conv;
35549 this_ptr_conv.inner = untag_ptr(this_ptr);
35550 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35551 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35552 this_ptr_conv.is_owned = false;
35553 LDKPublicKey val_ref;
35554 CHECK((*env)->GetArrayLength(env, val) == 33);
35555 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35556 OpenChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref);
35559 JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) {
35560 LDKOpenChannel this_ptr_conv;
35561 this_ptr_conv.inner = untag_ptr(this_ptr);
35562 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35563 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35564 this_ptr_conv.is_owned = false;
35565 int8_t ret_conv = OpenChannel_get_channel_flags(&this_ptr_conv);
35569 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) {
35570 LDKOpenChannel this_ptr_conv;
35571 this_ptr_conv.inner = untag_ptr(this_ptr);
35572 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35573 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35574 this_ptr_conv.is_owned = false;
35575 OpenChannel_set_channel_flags(&this_ptr_conv, val);
35578 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) {
35579 LDKOpenChannel this_ptr_conv;
35580 this_ptr_conv.inner = untag_ptr(this_ptr);
35581 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35582 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35583 this_ptr_conv.is_owned = false;
35584 LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv);
35585 int64_t ret_ref = 0;
35586 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35587 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35591 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35592 LDKOpenChannel this_ptr_conv;
35593 this_ptr_conv.inner = untag_ptr(this_ptr);
35594 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35595 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35596 this_ptr_conv.is_owned = false;
35597 LDKChannelTypeFeatures val_conv;
35598 val_conv.inner = untag_ptr(val);
35599 val_conv.is_owned = ptr_is_owned(val);
35600 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
35601 val_conv = ChannelTypeFeatures_clone(&val_conv);
35602 OpenChannel_set_channel_type(&this_ptr_conv, val_conv);
35605 static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) {
35606 LDKOpenChannel ret_var = OpenChannel_clone(arg);
35607 int64_t ret_ref = 0;
35608 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35609 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35612 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35613 LDKOpenChannel arg_conv;
35614 arg_conv.inner = untag_ptr(arg);
35615 arg_conv.is_owned = ptr_is_owned(arg);
35616 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35617 arg_conv.is_owned = false;
35618 int64_t ret_conv = OpenChannel_clone_ptr(&arg_conv);
35622 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35623 LDKOpenChannel orig_conv;
35624 orig_conv.inner = untag_ptr(orig);
35625 orig_conv.is_owned = ptr_is_owned(orig);
35626 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35627 orig_conv.is_owned = false;
35628 LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv);
35629 int64_t ret_ref = 0;
35630 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35631 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35635 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OpenChannel_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
35636 LDKOpenChannel a_conv;
35637 a_conv.inner = untag_ptr(a);
35638 a_conv.is_owned = ptr_is_owned(a);
35639 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35640 a_conv.is_owned = false;
35641 LDKOpenChannel b_conv;
35642 b_conv.inner = untag_ptr(b);
35643 b_conv.is_owned = ptr_is_owned(b);
35644 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35645 b_conv.is_owned = false;
35646 jboolean ret_conv = OpenChannel_eq(&a_conv, &b_conv);
35650 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
35651 LDKAcceptChannel this_obj_conv;
35652 this_obj_conv.inner = untag_ptr(this_obj);
35653 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35654 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35655 AcceptChannel_free(this_obj_conv);
35658 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
35659 LDKAcceptChannel this_ptr_conv;
35660 this_ptr_conv.inner = untag_ptr(this_ptr);
35661 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35662 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35663 this_ptr_conv.is_owned = false;
35664 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
35665 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv));
35669 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35670 LDKAcceptChannel this_ptr_conv;
35671 this_ptr_conv.inner = untag_ptr(this_ptr);
35672 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35673 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35674 this_ptr_conv.is_owned = false;
35675 LDKThirtyTwoBytes val_ref;
35676 CHECK((*env)->GetArrayLength(env, val) == 32);
35677 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
35678 AcceptChannel_set_temporary_channel_id(&this_ptr_conv, val_ref);
35681 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
35682 LDKAcceptChannel this_ptr_conv;
35683 this_ptr_conv.inner = untag_ptr(this_ptr);
35684 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35685 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35686 this_ptr_conv.is_owned = false;
35687 int64_t ret_conv = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv);
35691 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35692 LDKAcceptChannel this_ptr_conv;
35693 this_ptr_conv.inner = untag_ptr(this_ptr);
35694 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35695 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35696 this_ptr_conv.is_owned = false;
35697 AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
35700 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) {
35701 LDKAcceptChannel this_ptr_conv;
35702 this_ptr_conv.inner = untag_ptr(this_ptr);
35703 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35704 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35705 this_ptr_conv.is_owned = false;
35706 int64_t ret_conv = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
35710 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) {
35711 LDKAcceptChannel this_ptr_conv;
35712 this_ptr_conv.inner = untag_ptr(this_ptr);
35713 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35714 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35715 this_ptr_conv.is_owned = false;
35716 AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
35719 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
35720 LDKAcceptChannel this_ptr_conv;
35721 this_ptr_conv.inner = untag_ptr(this_ptr);
35722 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35723 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35724 this_ptr_conv.is_owned = false;
35725 int64_t ret_conv = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv);
35729 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35730 LDKAcceptChannel this_ptr_conv;
35731 this_ptr_conv.inner = untag_ptr(this_ptr);
35732 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35733 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35734 this_ptr_conv.is_owned = false;
35735 AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
35738 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
35739 LDKAcceptChannel this_ptr_conv;
35740 this_ptr_conv.inner = untag_ptr(this_ptr);
35741 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35742 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35743 this_ptr_conv.is_owned = false;
35744 int64_t ret_conv = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv);
35748 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35749 LDKAcceptChannel this_ptr_conv;
35750 this_ptr_conv.inner = untag_ptr(this_ptr);
35751 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35752 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35753 this_ptr_conv.is_owned = false;
35754 AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
35757 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr) {
35758 LDKAcceptChannel this_ptr_conv;
35759 this_ptr_conv.inner = untag_ptr(this_ptr);
35760 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35761 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35762 this_ptr_conv.is_owned = false;
35763 int32_t ret_conv = AcceptChannel_get_minimum_depth(&this_ptr_conv);
35767 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t 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 AcceptChannel_set_minimum_depth(&this_ptr_conv, val);
35776 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
35777 LDKAcceptChannel this_ptr_conv;
35778 this_ptr_conv.inner = untag_ptr(this_ptr);
35779 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35780 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35781 this_ptr_conv.is_owned = false;
35782 int16_t ret_conv = AcceptChannel_get_to_self_delay(&this_ptr_conv);
35786 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
35787 LDKAcceptChannel this_ptr_conv;
35788 this_ptr_conv.inner = untag_ptr(this_ptr);
35789 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35790 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35791 this_ptr_conv.is_owned = false;
35792 AcceptChannel_set_to_self_delay(&this_ptr_conv, val);
35795 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
35796 LDKAcceptChannel this_ptr_conv;
35797 this_ptr_conv.inner = untag_ptr(this_ptr);
35798 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35799 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35800 this_ptr_conv.is_owned = false;
35801 int16_t ret_conv = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv);
35805 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
35806 LDKAcceptChannel this_ptr_conv;
35807 this_ptr_conv.inner = untag_ptr(this_ptr);
35808 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35809 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35810 this_ptr_conv.is_owned = false;
35811 AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
35814 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
35815 LDKAcceptChannel this_ptr_conv;
35816 this_ptr_conv.inner = untag_ptr(this_ptr);
35817 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35818 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35819 this_ptr_conv.is_owned = false;
35820 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35821 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form);
35825 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
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 LDKPublicKey val_ref;
35832 CHECK((*env)->GetArrayLength(env, val) == 33);
35833 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35834 AcceptChannel_set_funding_pubkey(&this_ptr_conv, val_ref);
35837 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
35838 LDKAcceptChannel this_ptr_conv;
35839 this_ptr_conv.inner = untag_ptr(this_ptr);
35840 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35841 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35842 this_ptr_conv.is_owned = false;
35843 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35844 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form);
35848 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
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 LDKPublicKey val_ref;
35855 CHECK((*env)->GetArrayLength(env, val) == 33);
35856 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35857 AcceptChannel_set_revocation_basepoint(&this_ptr_conv, val_ref);
35860 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
35861 LDKAcceptChannel this_ptr_conv;
35862 this_ptr_conv.inner = untag_ptr(this_ptr);
35863 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35864 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35865 this_ptr_conv.is_owned = false;
35866 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35867 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form);
35871 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
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 LDKPublicKey val_ref;
35878 CHECK((*env)->GetArrayLength(env, val) == 33);
35879 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35880 AcceptChannel_set_payment_point(&this_ptr_conv, val_ref);
35883 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
35884 LDKAcceptChannel this_ptr_conv;
35885 this_ptr_conv.inner = untag_ptr(this_ptr);
35886 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35887 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35888 this_ptr_conv.is_owned = false;
35889 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35890 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
35894 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35895 LDKAcceptChannel this_ptr_conv;
35896 this_ptr_conv.inner = untag_ptr(this_ptr);
35897 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35898 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35899 this_ptr_conv.is_owned = false;
35900 LDKPublicKey val_ref;
35901 CHECK((*env)->GetArrayLength(env, val) == 33);
35902 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35903 AcceptChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
35906 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
35907 LDKAcceptChannel this_ptr_conv;
35908 this_ptr_conv.inner = untag_ptr(this_ptr);
35909 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35910 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35911 this_ptr_conv.is_owned = false;
35912 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35913 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form);
35917 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
35918 LDKAcceptChannel this_ptr_conv;
35919 this_ptr_conv.inner = untag_ptr(this_ptr);
35920 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35921 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35922 this_ptr_conv.is_owned = false;
35923 LDKPublicKey val_ref;
35924 CHECK((*env)->GetArrayLength(env, val) == 33);
35925 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35926 AcceptChannel_set_htlc_basepoint(&this_ptr_conv, val_ref);
35929 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
35930 LDKAcceptChannel this_ptr_conv;
35931 this_ptr_conv.inner = untag_ptr(this_ptr);
35932 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35933 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35934 this_ptr_conv.is_owned = false;
35935 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
35936 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form);
35940 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) {
35941 LDKAcceptChannel this_ptr_conv;
35942 this_ptr_conv.inner = untag_ptr(this_ptr);
35943 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35944 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35945 this_ptr_conv.is_owned = false;
35946 LDKPublicKey val_ref;
35947 CHECK((*env)->GetArrayLength(env, val) == 33);
35948 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
35949 AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref);
35952 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr) {
35953 LDKAcceptChannel this_ptr_conv;
35954 this_ptr_conv.inner = untag_ptr(this_ptr);
35955 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35956 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35957 this_ptr_conv.is_owned = false;
35958 LDKChannelTypeFeatures ret_var = AcceptChannel_get_channel_type(&this_ptr_conv);
35959 int64_t ret_ref = 0;
35960 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35961 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35965 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1type(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
35966 LDKAcceptChannel this_ptr_conv;
35967 this_ptr_conv.inner = untag_ptr(this_ptr);
35968 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35969 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35970 this_ptr_conv.is_owned = false;
35971 LDKChannelTypeFeatures val_conv;
35972 val_conv.inner = untag_ptr(val);
35973 val_conv.is_owned = ptr_is_owned(val);
35974 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
35975 val_conv = ChannelTypeFeatures_clone(&val_conv);
35976 AcceptChannel_set_channel_type(&this_ptr_conv, val_conv);
35979 static inline uint64_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) {
35980 LDKAcceptChannel ret_var = AcceptChannel_clone(arg);
35981 int64_t ret_ref = 0;
35982 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35983 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35986 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
35987 LDKAcceptChannel arg_conv;
35988 arg_conv.inner = untag_ptr(arg);
35989 arg_conv.is_owned = ptr_is_owned(arg);
35990 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35991 arg_conv.is_owned = false;
35992 int64_t ret_conv = AcceptChannel_clone_ptr(&arg_conv);
35996 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone(JNIEnv *env, jclass clz, int64_t orig) {
35997 LDKAcceptChannel orig_conv;
35998 orig_conv.inner = untag_ptr(orig);
35999 orig_conv.is_owned = ptr_is_owned(orig);
36000 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36001 orig_conv.is_owned = false;
36002 LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv);
36003 int64_t ret_ref = 0;
36004 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36005 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36009 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36010 LDKAcceptChannel a_conv;
36011 a_conv.inner = untag_ptr(a);
36012 a_conv.is_owned = ptr_is_owned(a);
36013 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36014 a_conv.is_owned = false;
36015 LDKAcceptChannel b_conv;
36016 b_conv.inner = untag_ptr(b);
36017 b_conv.is_owned = ptr_is_owned(b);
36018 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36019 b_conv.is_owned = false;
36020 jboolean ret_conv = AcceptChannel_eq(&a_conv, &b_conv);
36024 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36025 LDKFundingCreated this_obj_conv;
36026 this_obj_conv.inner = untag_ptr(this_obj);
36027 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36028 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36029 FundingCreated_free(this_obj_conv);
36032 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36033 LDKFundingCreated this_ptr_conv;
36034 this_ptr_conv.inner = untag_ptr(this_ptr);
36035 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36036 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36037 this_ptr_conv.is_owned = false;
36038 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36039 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(&this_ptr_conv));
36043 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36044 LDKFundingCreated this_ptr_conv;
36045 this_ptr_conv.inner = untag_ptr(this_ptr);
36046 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36047 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36048 this_ptr_conv.is_owned = false;
36049 LDKThirtyTwoBytes val_ref;
36050 CHECK((*env)->GetArrayLength(env, val) == 32);
36051 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36052 FundingCreated_set_temporary_channel_id(&this_ptr_conv, val_ref);
36055 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) {
36056 LDKFundingCreated this_ptr_conv;
36057 this_ptr_conv.inner = untag_ptr(this_ptr);
36058 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36059 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36060 this_ptr_conv.is_owned = false;
36061 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36062 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(&this_ptr_conv));
36066 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36067 LDKFundingCreated this_ptr_conv;
36068 this_ptr_conv.inner = untag_ptr(this_ptr);
36069 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36070 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36071 this_ptr_conv.is_owned = false;
36072 LDKThirtyTwoBytes val_ref;
36073 CHECK((*env)->GetArrayLength(env, val) == 32);
36074 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36075 FundingCreated_set_funding_txid(&this_ptr_conv, val_ref);
36078 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr) {
36079 LDKFundingCreated this_ptr_conv;
36080 this_ptr_conv.inner = untag_ptr(this_ptr);
36081 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36082 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36083 this_ptr_conv.is_owned = false;
36084 int16_t ret_conv = FundingCreated_get_funding_output_index(&this_ptr_conv);
36088 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
36089 LDKFundingCreated this_ptr_conv;
36090 this_ptr_conv.inner = untag_ptr(this_ptr);
36091 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36092 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36093 this_ptr_conv.is_owned = false;
36094 FundingCreated_set_funding_output_index(&this_ptr_conv, val);
36097 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
36098 LDKFundingCreated this_ptr_conv;
36099 this_ptr_conv.inner = untag_ptr(this_ptr);
36100 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36101 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36102 this_ptr_conv.is_owned = false;
36103 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
36104 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingCreated_get_signature(&this_ptr_conv).compact_form);
36108 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36109 LDKFundingCreated this_ptr_conv;
36110 this_ptr_conv.inner = untag_ptr(this_ptr);
36111 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36112 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36113 this_ptr_conv.is_owned = false;
36114 LDKSignature val_ref;
36115 CHECK((*env)->GetArrayLength(env, val) == 64);
36116 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
36117 FundingCreated_set_signature(&this_ptr_conv, val_ref);
36120 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) {
36121 LDKThirtyTwoBytes temporary_channel_id_arg_ref;
36122 CHECK((*env)->GetArrayLength(env, temporary_channel_id_arg) == 32);
36123 (*env)->GetByteArrayRegion(env, temporary_channel_id_arg, 0, 32, temporary_channel_id_arg_ref.data);
36124 LDKThirtyTwoBytes funding_txid_arg_ref;
36125 CHECK((*env)->GetArrayLength(env, funding_txid_arg) == 32);
36126 (*env)->GetByteArrayRegion(env, funding_txid_arg, 0, 32, funding_txid_arg_ref.data);
36127 LDKSignature signature_arg_ref;
36128 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
36129 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
36130 LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref);
36131 int64_t ret_ref = 0;
36132 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36133 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36137 static inline uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) {
36138 LDKFundingCreated ret_var = FundingCreated_clone(arg);
36139 int64_t ret_ref = 0;
36140 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36141 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36144 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36145 LDKFundingCreated arg_conv;
36146 arg_conv.inner = untag_ptr(arg);
36147 arg_conv.is_owned = ptr_is_owned(arg);
36148 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36149 arg_conv.is_owned = false;
36150 int64_t ret_conv = FundingCreated_clone_ptr(&arg_conv);
36154 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36155 LDKFundingCreated orig_conv;
36156 orig_conv.inner = untag_ptr(orig);
36157 orig_conv.is_owned = ptr_is_owned(orig);
36158 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36159 orig_conv.is_owned = false;
36160 LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv);
36161 int64_t ret_ref = 0;
36162 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36163 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36167 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_FundingCreated_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36168 LDKFundingCreated a_conv;
36169 a_conv.inner = untag_ptr(a);
36170 a_conv.is_owned = ptr_is_owned(a);
36171 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36172 a_conv.is_owned = false;
36173 LDKFundingCreated b_conv;
36174 b_conv.inner = untag_ptr(b);
36175 b_conv.is_owned = ptr_is_owned(b);
36176 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36177 b_conv.is_owned = false;
36178 jboolean ret_conv = FundingCreated_eq(&a_conv, &b_conv);
36182 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36183 LDKFundingSigned this_obj_conv;
36184 this_obj_conv.inner = untag_ptr(this_obj);
36185 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36186 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36187 FundingSigned_free(this_obj_conv);
36190 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36191 LDKFundingSigned this_ptr_conv;
36192 this_ptr_conv.inner = untag_ptr(this_ptr);
36193 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36194 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36195 this_ptr_conv.is_owned = false;
36196 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36197 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *FundingSigned_get_channel_id(&this_ptr_conv));
36201 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36202 LDKFundingSigned this_ptr_conv;
36203 this_ptr_conv.inner = untag_ptr(this_ptr);
36204 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36205 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36206 this_ptr_conv.is_owned = false;
36207 LDKThirtyTwoBytes val_ref;
36208 CHECK((*env)->GetArrayLength(env, val) == 32);
36209 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36210 FundingSigned_set_channel_id(&this_ptr_conv, val_ref);
36213 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
36214 LDKFundingSigned this_ptr_conv;
36215 this_ptr_conv.inner = untag_ptr(this_ptr);
36216 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36217 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36218 this_ptr_conv.is_owned = false;
36219 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
36220 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, FundingSigned_get_signature(&this_ptr_conv).compact_form);
36224 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36225 LDKFundingSigned this_ptr_conv;
36226 this_ptr_conv.inner = untag_ptr(this_ptr);
36227 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36228 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36229 this_ptr_conv.is_owned = false;
36230 LDKSignature val_ref;
36231 CHECK((*env)->GetArrayLength(env, val) == 64);
36232 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
36233 FundingSigned_set_signature(&this_ptr_conv, val_ref);
36236 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray signature_arg) {
36237 LDKThirtyTwoBytes channel_id_arg_ref;
36238 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
36239 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
36240 LDKSignature signature_arg_ref;
36241 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
36242 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
36243 LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref);
36244 int64_t ret_ref = 0;
36245 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36246 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36250 static inline uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) {
36251 LDKFundingSigned ret_var = FundingSigned_clone(arg);
36252 int64_t ret_ref = 0;
36253 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36254 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36257 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36258 LDKFundingSigned arg_conv;
36259 arg_conv.inner = untag_ptr(arg);
36260 arg_conv.is_owned = ptr_is_owned(arg);
36261 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36262 arg_conv.is_owned = false;
36263 int64_t ret_conv = FundingSigned_clone_ptr(&arg_conv);
36267 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36268 LDKFundingSigned orig_conv;
36269 orig_conv.inner = untag_ptr(orig);
36270 orig_conv.is_owned = ptr_is_owned(orig);
36271 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36272 orig_conv.is_owned = false;
36273 LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv);
36274 int64_t ret_ref = 0;
36275 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36276 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36280 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_FundingSigned_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36281 LDKFundingSigned a_conv;
36282 a_conv.inner = untag_ptr(a);
36283 a_conv.is_owned = ptr_is_owned(a);
36284 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36285 a_conv.is_owned = false;
36286 LDKFundingSigned b_conv;
36287 b_conv.inner = untag_ptr(b);
36288 b_conv.is_owned = ptr_is_owned(b);
36289 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36290 b_conv.is_owned = false;
36291 jboolean ret_conv = FundingSigned_eq(&a_conv, &b_conv);
36295 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36296 LDKChannelReady this_obj_conv;
36297 this_obj_conv.inner = untag_ptr(this_obj);
36298 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36299 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36300 ChannelReady_free(this_obj_conv);
36303 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36304 LDKChannelReady this_ptr_conv;
36305 this_ptr_conv.inner = untag_ptr(this_ptr);
36306 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36307 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36308 this_ptr_conv.is_owned = false;
36309 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36310 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelReady_get_channel_id(&this_ptr_conv));
36314 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36315 LDKChannelReady this_ptr_conv;
36316 this_ptr_conv.inner = untag_ptr(this_ptr);
36317 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36318 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36319 this_ptr_conv.is_owned = false;
36320 LDKThirtyTwoBytes val_ref;
36321 CHECK((*env)->GetArrayLength(env, val) == 32);
36322 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36323 ChannelReady_set_channel_id(&this_ptr_conv, val_ref);
36326 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
36327 LDKChannelReady this_ptr_conv;
36328 this_ptr_conv.inner = untag_ptr(this_ptr);
36329 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36330 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36331 this_ptr_conv.is_owned = false;
36332 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
36333 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelReady_get_next_per_commitment_point(&this_ptr_conv).compressed_form);
36337 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) {
36338 LDKChannelReady this_ptr_conv;
36339 this_ptr_conv.inner = untag_ptr(this_ptr);
36340 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36341 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36342 this_ptr_conv.is_owned = false;
36343 LDKPublicKey val_ref;
36344 CHECK((*env)->GetArrayLength(env, val) == 33);
36345 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
36346 ChannelReady_set_next_per_commitment_point(&this_ptr_conv, val_ref);
36349 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1get_1short_1channel_1id_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) {
36350 LDKChannelReady this_ptr_conv;
36351 this_ptr_conv.inner = untag_ptr(this_ptr);
36352 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36353 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36354 this_ptr_conv.is_owned = false;
36355 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
36356 *ret_copy = ChannelReady_get_short_channel_id_alias(&this_ptr_conv);
36357 int64_t ret_ref = tag_ptr(ret_copy, true);
36361 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) {
36362 LDKChannelReady this_ptr_conv;
36363 this_ptr_conv.inner = untag_ptr(this_ptr);
36364 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36365 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36366 this_ptr_conv.is_owned = false;
36367 void* val_ptr = untag_ptr(val);
36368 CHECK_ACCESS(val_ptr);
36369 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
36370 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
36371 ChannelReady_set_short_channel_id_alias(&this_ptr_conv, val_conv);
36374 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) {
36375 LDKThirtyTwoBytes channel_id_arg_ref;
36376 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
36377 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
36378 LDKPublicKey next_per_commitment_point_arg_ref;
36379 CHECK((*env)->GetArrayLength(env, next_per_commitment_point_arg) == 33);
36380 (*env)->GetByteArrayRegion(env, next_per_commitment_point_arg, 0, 33, next_per_commitment_point_arg_ref.compressed_form);
36381 void* short_channel_id_alias_arg_ptr = untag_ptr(short_channel_id_alias_arg);
36382 CHECK_ACCESS(short_channel_id_alias_arg_ptr);
36383 LDKCOption_u64Z short_channel_id_alias_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_alias_arg_ptr);
36384 short_channel_id_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_alias_arg));
36385 LDKChannelReady ret_var = ChannelReady_new(channel_id_arg_ref, next_per_commitment_point_arg_ref, short_channel_id_alias_arg_conv);
36386 int64_t ret_ref = 0;
36387 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36388 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36392 static inline uint64_t ChannelReady_clone_ptr(LDKChannelReady *NONNULL_PTR arg) {
36393 LDKChannelReady ret_var = ChannelReady_clone(arg);
36394 int64_t ret_ref = 0;
36395 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36396 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36399 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36400 LDKChannelReady arg_conv;
36401 arg_conv.inner = untag_ptr(arg);
36402 arg_conv.is_owned = ptr_is_owned(arg);
36403 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36404 arg_conv.is_owned = false;
36405 int64_t ret_conv = ChannelReady_clone_ptr(&arg_conv);
36409 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36410 LDKChannelReady orig_conv;
36411 orig_conv.inner = untag_ptr(orig);
36412 orig_conv.is_owned = ptr_is_owned(orig);
36413 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36414 orig_conv.is_owned = false;
36415 LDKChannelReady ret_var = ChannelReady_clone(&orig_conv);
36416 int64_t ret_ref = 0;
36417 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36418 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36422 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelReady_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36423 LDKChannelReady a_conv;
36424 a_conv.inner = untag_ptr(a);
36425 a_conv.is_owned = ptr_is_owned(a);
36426 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36427 a_conv.is_owned = false;
36428 LDKChannelReady b_conv;
36429 b_conv.inner = untag_ptr(b);
36430 b_conv.is_owned = ptr_is_owned(b);
36431 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36432 b_conv.is_owned = false;
36433 jboolean ret_conv = ChannelReady_eq(&a_conv, &b_conv);
36437 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36438 LDKShutdown this_obj_conv;
36439 this_obj_conv.inner = untag_ptr(this_obj);
36440 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36441 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36442 Shutdown_free(this_obj_conv);
36445 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36446 LDKShutdown this_ptr_conv;
36447 this_ptr_conv.inner = untag_ptr(this_ptr);
36448 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36449 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36450 this_ptr_conv.is_owned = false;
36451 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36452 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Shutdown_get_channel_id(&this_ptr_conv));
36456 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36457 LDKShutdown this_ptr_conv;
36458 this_ptr_conv.inner = untag_ptr(this_ptr);
36459 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36460 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36461 this_ptr_conv.is_owned = false;
36462 LDKThirtyTwoBytes val_ref;
36463 CHECK((*env)->GetArrayLength(env, val) == 32);
36464 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36465 Shutdown_set_channel_id(&this_ptr_conv, val_ref);
36468 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
36469 LDKShutdown this_ptr_conv;
36470 this_ptr_conv.inner = untag_ptr(this_ptr);
36471 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36472 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36473 this_ptr_conv.is_owned = false;
36474 LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv);
36475 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
36476 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
36480 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36481 LDKShutdown 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 LDKCVec_u8Z val_ref;
36487 val_ref.datalen = (*env)->GetArrayLength(env, val);
36488 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
36489 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
36490 Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref);
36493 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv *env, jclass clz, int8_tArray channel_id_arg, int8_tArray scriptpubkey_arg) {
36494 LDKThirtyTwoBytes channel_id_arg_ref;
36495 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
36496 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
36497 LDKCVec_u8Z scriptpubkey_arg_ref;
36498 scriptpubkey_arg_ref.datalen = (*env)->GetArrayLength(env, scriptpubkey_arg);
36499 scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
36500 (*env)->GetByteArrayRegion(env, scriptpubkey_arg, 0, scriptpubkey_arg_ref.datalen, scriptpubkey_arg_ref.data);
36501 LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref);
36502 int64_t ret_ref = 0;
36503 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36504 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36508 static inline uint64_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) {
36509 LDKShutdown ret_var = Shutdown_clone(arg);
36510 int64_t ret_ref = 0;
36511 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36512 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36515 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36516 LDKShutdown arg_conv;
36517 arg_conv.inner = untag_ptr(arg);
36518 arg_conv.is_owned = ptr_is_owned(arg);
36519 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36520 arg_conv.is_owned = false;
36521 int64_t ret_conv = Shutdown_clone_ptr(&arg_conv);
36525 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36526 LDKShutdown orig_conv;
36527 orig_conv.inner = untag_ptr(orig);
36528 orig_conv.is_owned = ptr_is_owned(orig);
36529 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36530 orig_conv.is_owned = false;
36531 LDKShutdown ret_var = Shutdown_clone(&orig_conv);
36532 int64_t ret_ref = 0;
36533 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36534 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36538 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Shutdown_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36539 LDKShutdown a_conv;
36540 a_conv.inner = untag_ptr(a);
36541 a_conv.is_owned = ptr_is_owned(a);
36542 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36543 a_conv.is_owned = false;
36544 LDKShutdown b_conv;
36545 b_conv.inner = untag_ptr(b);
36546 b_conv.is_owned = ptr_is_owned(b);
36547 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36548 b_conv.is_owned = false;
36549 jboolean ret_conv = Shutdown_eq(&a_conv, &b_conv);
36553 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36554 LDKClosingSignedFeeRange this_obj_conv;
36555 this_obj_conv.inner = untag_ptr(this_obj);
36556 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36557 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36558 ClosingSignedFeeRange_free(this_obj_conv);
36561 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_1min_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
36562 LDKClosingSignedFeeRange this_ptr_conv;
36563 this_ptr_conv.inner = untag_ptr(this_ptr);
36564 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36565 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36566 this_ptr_conv.is_owned = false;
36567 int64_t ret_conv = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv);
36571 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1min_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36572 LDKClosingSignedFeeRange this_ptr_conv;
36573 this_ptr_conv.inner = untag_ptr(this_ptr);
36574 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36575 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36576 this_ptr_conv.is_owned = false;
36577 ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val);
36580 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1get_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
36581 LDKClosingSignedFeeRange this_ptr_conv;
36582 this_ptr_conv.inner = untag_ptr(this_ptr);
36583 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36584 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36585 this_ptr_conv.is_owned = false;
36586 int64_t ret_conv = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv);
36590 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1set_1max_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36591 LDKClosingSignedFeeRange 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 ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val);
36599 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) {
36600 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg);
36601 int64_t ret_ref = 0;
36602 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36603 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36607 static inline uint64_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) {
36608 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg);
36609 int64_t ret_ref = 0;
36610 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36611 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36614 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36615 LDKClosingSignedFeeRange arg_conv;
36616 arg_conv.inner = untag_ptr(arg);
36617 arg_conv.is_owned = ptr_is_owned(arg);
36618 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36619 arg_conv.is_owned = false;
36620 int64_t ret_conv = ClosingSignedFeeRange_clone_ptr(&arg_conv);
36624 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36625 LDKClosingSignedFeeRange orig_conv;
36626 orig_conv.inner = untag_ptr(orig);
36627 orig_conv.is_owned = ptr_is_owned(orig);
36628 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36629 orig_conv.is_owned = false;
36630 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv);
36631 int64_t ret_ref = 0;
36632 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36633 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36637 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36638 LDKClosingSignedFeeRange a_conv;
36639 a_conv.inner = untag_ptr(a);
36640 a_conv.is_owned = ptr_is_owned(a);
36641 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36642 a_conv.is_owned = false;
36643 LDKClosingSignedFeeRange b_conv;
36644 b_conv.inner = untag_ptr(b);
36645 b_conv.is_owned = ptr_is_owned(b);
36646 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36647 b_conv.is_owned = false;
36648 jboolean ret_conv = ClosingSignedFeeRange_eq(&a_conv, &b_conv);
36652 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36653 LDKClosingSigned this_obj_conv;
36654 this_obj_conv.inner = untag_ptr(this_obj);
36655 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36656 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36657 ClosingSigned_free(this_obj_conv);
36660 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36661 LDKClosingSigned this_ptr_conv;
36662 this_ptr_conv.inner = untag_ptr(this_ptr);
36663 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36664 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36665 this_ptr_conv.is_owned = false;
36666 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36667 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(&this_ptr_conv));
36671 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36672 LDKClosingSigned this_ptr_conv;
36673 this_ptr_conv.inner = untag_ptr(this_ptr);
36674 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36675 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36676 this_ptr_conv.is_owned = false;
36677 LDKThirtyTwoBytes val_ref;
36678 CHECK((*env)->GetArrayLength(env, val) == 32);
36679 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36680 ClosingSigned_set_channel_id(&this_ptr_conv, val_ref);
36683 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr) {
36684 LDKClosingSigned this_ptr_conv;
36685 this_ptr_conv.inner = untag_ptr(this_ptr);
36686 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36687 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36688 this_ptr_conv.is_owned = false;
36689 int64_t ret_conv = ClosingSigned_get_fee_satoshis(&this_ptr_conv);
36693 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36694 LDKClosingSigned this_ptr_conv;
36695 this_ptr_conv.inner = untag_ptr(this_ptr);
36696 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36697 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36698 this_ptr_conv.is_owned = false;
36699 ClosingSigned_set_fee_satoshis(&this_ptr_conv, val);
36702 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
36703 LDKClosingSigned this_ptr_conv;
36704 this_ptr_conv.inner = untag_ptr(this_ptr);
36705 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36706 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36707 this_ptr_conv.is_owned = false;
36708 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
36709 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ClosingSigned_get_signature(&this_ptr_conv).compact_form);
36713 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36714 LDKClosingSigned this_ptr_conv;
36715 this_ptr_conv.inner = untag_ptr(this_ptr);
36716 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36717 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36718 this_ptr_conv.is_owned = false;
36719 LDKSignature val_ref;
36720 CHECK((*env)->GetArrayLength(env, val) == 64);
36721 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
36722 ClosingSigned_set_signature(&this_ptr_conv, val_ref);
36725 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1range(JNIEnv *env, jclass clz, int64_t this_ptr) {
36726 LDKClosingSigned this_ptr_conv;
36727 this_ptr_conv.inner = untag_ptr(this_ptr);
36728 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36729 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36730 this_ptr_conv.is_owned = false;
36731 LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv);
36732 int64_t ret_ref = 0;
36733 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36734 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36738 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1range(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36739 LDKClosingSigned this_ptr_conv;
36740 this_ptr_conv.inner = untag_ptr(this_ptr);
36741 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36742 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36743 this_ptr_conv.is_owned = false;
36744 LDKClosingSignedFeeRange val_conv;
36745 val_conv.inner = untag_ptr(val);
36746 val_conv.is_owned = ptr_is_owned(val);
36747 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
36748 val_conv = ClosingSignedFeeRange_clone(&val_conv);
36749 ClosingSigned_set_fee_range(&this_ptr_conv, val_conv);
36752 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) {
36753 LDKThirtyTwoBytes channel_id_arg_ref;
36754 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
36755 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
36756 LDKSignature signature_arg_ref;
36757 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
36758 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
36759 LDKClosingSignedFeeRange fee_range_arg_conv;
36760 fee_range_arg_conv.inner = untag_ptr(fee_range_arg);
36761 fee_range_arg_conv.is_owned = ptr_is_owned(fee_range_arg);
36762 CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv);
36763 fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv);
36764 LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv);
36765 int64_t ret_ref = 0;
36766 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36767 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36771 static inline uint64_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) {
36772 LDKClosingSigned ret_var = ClosingSigned_clone(arg);
36773 int64_t ret_ref = 0;
36774 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36775 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36778 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36779 LDKClosingSigned arg_conv;
36780 arg_conv.inner = untag_ptr(arg);
36781 arg_conv.is_owned = ptr_is_owned(arg);
36782 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36783 arg_conv.is_owned = false;
36784 int64_t ret_conv = ClosingSigned_clone_ptr(&arg_conv);
36788 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36789 LDKClosingSigned orig_conv;
36790 orig_conv.inner = untag_ptr(orig);
36791 orig_conv.is_owned = ptr_is_owned(orig);
36792 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36793 orig_conv.is_owned = false;
36794 LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv);
36795 int64_t ret_ref = 0;
36796 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36797 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36801 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36802 LDKClosingSigned a_conv;
36803 a_conv.inner = untag_ptr(a);
36804 a_conv.is_owned = ptr_is_owned(a);
36805 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36806 a_conv.is_owned = false;
36807 LDKClosingSigned b_conv;
36808 b_conv.inner = untag_ptr(b);
36809 b_conv.is_owned = ptr_is_owned(b);
36810 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36811 b_conv.is_owned = false;
36812 jboolean ret_conv = ClosingSigned_eq(&a_conv, &b_conv);
36816 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36817 LDKUpdateAddHTLC this_obj_conv;
36818 this_obj_conv.inner = untag_ptr(this_obj);
36819 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36820 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36821 UpdateAddHTLC_free(this_obj_conv);
36824 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36825 LDKUpdateAddHTLC this_ptr_conv;
36826 this_ptr_conv.inner = untag_ptr(this_ptr);
36827 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36828 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36829 this_ptr_conv.is_owned = false;
36830 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36831 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(&this_ptr_conv));
36835 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36836 LDKUpdateAddHTLC this_ptr_conv;
36837 this_ptr_conv.inner = untag_ptr(this_ptr);
36838 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36839 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36840 this_ptr_conv.is_owned = false;
36841 LDKThirtyTwoBytes val_ref;
36842 CHECK((*env)->GetArrayLength(env, val) == 32);
36843 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36844 UpdateAddHTLC_set_channel_id(&this_ptr_conv, val_ref);
36847 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
36848 LDKUpdateAddHTLC this_ptr_conv;
36849 this_ptr_conv.inner = untag_ptr(this_ptr);
36850 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36851 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36852 this_ptr_conv.is_owned = false;
36853 int64_t ret_conv = UpdateAddHTLC_get_htlc_id(&this_ptr_conv);
36857 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36858 LDKUpdateAddHTLC this_ptr_conv;
36859 this_ptr_conv.inner = untag_ptr(this_ptr);
36860 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36861 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36862 this_ptr_conv.is_owned = false;
36863 UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val);
36866 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
36867 LDKUpdateAddHTLC this_ptr_conv;
36868 this_ptr_conv.inner = untag_ptr(this_ptr);
36869 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36870 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36871 this_ptr_conv.is_owned = false;
36872 int64_t ret_conv = UpdateAddHTLC_get_amount_msat(&this_ptr_conv);
36876 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
36877 LDKUpdateAddHTLC this_ptr_conv;
36878 this_ptr_conv.inner = untag_ptr(this_ptr);
36879 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36880 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36881 this_ptr_conv.is_owned = false;
36882 UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val);
36885 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
36886 LDKUpdateAddHTLC this_ptr_conv;
36887 this_ptr_conv.inner = untag_ptr(this_ptr);
36888 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36889 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36890 this_ptr_conv.is_owned = false;
36891 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
36892 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv));
36896 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36897 LDKUpdateAddHTLC this_ptr_conv;
36898 this_ptr_conv.inner = untag_ptr(this_ptr);
36899 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36900 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36901 this_ptr_conv.is_owned = false;
36902 LDKThirtyTwoBytes val_ref;
36903 CHECK((*env)->GetArrayLength(env, val) == 32);
36904 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
36905 UpdateAddHTLC_set_payment_hash(&this_ptr_conv, val_ref);
36908 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) {
36909 LDKUpdateAddHTLC this_ptr_conv;
36910 this_ptr_conv.inner = untag_ptr(this_ptr);
36911 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36912 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36913 this_ptr_conv.is_owned = false;
36914 int32_t ret_conv = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv);
36918 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
36919 LDKUpdateAddHTLC this_ptr_conv;
36920 this_ptr_conv.inner = untag_ptr(this_ptr);
36921 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36922 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36923 this_ptr_conv.is_owned = false;
36924 UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val);
36927 static inline uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) {
36928 LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg);
36929 int64_t ret_ref = 0;
36930 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36931 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36934 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
36935 LDKUpdateAddHTLC arg_conv;
36936 arg_conv.inner = untag_ptr(arg);
36937 arg_conv.is_owned = ptr_is_owned(arg);
36938 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
36939 arg_conv.is_owned = false;
36940 int64_t ret_conv = UpdateAddHTLC_clone_ptr(&arg_conv);
36944 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
36945 LDKUpdateAddHTLC orig_conv;
36946 orig_conv.inner = untag_ptr(orig);
36947 orig_conv.is_owned = ptr_is_owned(orig);
36948 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
36949 orig_conv.is_owned = false;
36950 LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv);
36951 int64_t ret_ref = 0;
36952 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36953 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36957 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
36958 LDKUpdateAddHTLC a_conv;
36959 a_conv.inner = untag_ptr(a);
36960 a_conv.is_owned = ptr_is_owned(a);
36961 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
36962 a_conv.is_owned = false;
36963 LDKUpdateAddHTLC b_conv;
36964 b_conv.inner = untag_ptr(b);
36965 b_conv.is_owned = ptr_is_owned(b);
36966 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
36967 b_conv.is_owned = false;
36968 jboolean ret_conv = UpdateAddHTLC_eq(&a_conv, &b_conv);
36972 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
36973 LDKOnionMessage this_obj_conv;
36974 this_obj_conv.inner = untag_ptr(this_obj);
36975 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36976 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36977 OnionMessage_free(this_obj_conv);
36980 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OnionMessage_1get_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
36981 LDKOnionMessage this_ptr_conv;
36982 this_ptr_conv.inner = untag_ptr(this_ptr);
36983 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36984 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36985 this_ptr_conv.is_owned = false;
36986 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
36987 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, OnionMessage_get_blinding_point(&this_ptr_conv).compressed_form);
36991 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessage_1set_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
36992 LDKOnionMessage this_ptr_conv;
36993 this_ptr_conv.inner = untag_ptr(this_ptr);
36994 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
36995 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
36996 this_ptr_conv.is_owned = false;
36997 LDKPublicKey val_ref;
36998 CHECK((*env)->GetArrayLength(env, val) == 33);
36999 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
37000 OnionMessage_set_blinding_point(&this_ptr_conv, val_ref);
37003 static inline uint64_t OnionMessage_clone_ptr(LDKOnionMessage *NONNULL_PTR arg) {
37004 LDKOnionMessage ret_var = OnionMessage_clone(arg);
37005 int64_t ret_ref = 0;
37006 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37007 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37010 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37011 LDKOnionMessage arg_conv;
37012 arg_conv.inner = untag_ptr(arg);
37013 arg_conv.is_owned = ptr_is_owned(arg);
37014 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37015 arg_conv.is_owned = false;
37016 int64_t ret_conv = OnionMessage_clone_ptr(&arg_conv);
37020 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37021 LDKOnionMessage orig_conv;
37022 orig_conv.inner = untag_ptr(orig);
37023 orig_conv.is_owned = ptr_is_owned(orig);
37024 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37025 orig_conv.is_owned = false;
37026 LDKOnionMessage ret_var = OnionMessage_clone(&orig_conv);
37027 int64_t ret_ref = 0;
37028 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37029 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37033 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OnionMessage_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37034 LDKOnionMessage a_conv;
37035 a_conv.inner = untag_ptr(a);
37036 a_conv.is_owned = ptr_is_owned(a);
37037 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37038 a_conv.is_owned = false;
37039 LDKOnionMessage b_conv;
37040 b_conv.inner = untag_ptr(b);
37041 b_conv.is_owned = ptr_is_owned(b);
37042 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37043 b_conv.is_owned = false;
37044 jboolean ret_conv = OnionMessage_eq(&a_conv, &b_conv);
37048 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37049 LDKUpdateFulfillHTLC this_obj_conv;
37050 this_obj_conv.inner = untag_ptr(this_obj);
37051 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37052 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37053 UpdateFulfillHTLC_free(this_obj_conv);
37056 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37057 LDKUpdateFulfillHTLC this_ptr_conv;
37058 this_ptr_conv.inner = untag_ptr(this_ptr);
37059 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37060 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37061 this_ptr_conv.is_owned = false;
37062 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37063 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv));
37067 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37068 LDKUpdateFulfillHTLC this_ptr_conv;
37069 this_ptr_conv.inner = untag_ptr(this_ptr);
37070 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37071 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37072 this_ptr_conv.is_owned = false;
37073 LDKThirtyTwoBytes val_ref;
37074 CHECK((*env)->GetArrayLength(env, val) == 32);
37075 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37076 UpdateFulfillHTLC_set_channel_id(&this_ptr_conv, val_ref);
37079 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37080 LDKUpdateFulfillHTLC this_ptr_conv;
37081 this_ptr_conv.inner = untag_ptr(this_ptr);
37082 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37083 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37084 this_ptr_conv.is_owned = false;
37085 int64_t ret_conv = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv);
37089 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
37090 LDKUpdateFulfillHTLC this_ptr_conv;
37091 this_ptr_conv.inner = untag_ptr(this_ptr);
37092 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37093 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37094 this_ptr_conv.is_owned = false;
37095 UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val);
37098 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr) {
37099 LDKUpdateFulfillHTLC this_ptr_conv;
37100 this_ptr_conv.inner = untag_ptr(this_ptr);
37101 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37102 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37103 this_ptr_conv.is_owned = false;
37104 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37105 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv));
37109 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37110 LDKUpdateFulfillHTLC this_ptr_conv;
37111 this_ptr_conv.inner = untag_ptr(this_ptr);
37112 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37113 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37114 this_ptr_conv.is_owned = false;
37115 LDKThirtyTwoBytes val_ref;
37116 CHECK((*env)->GetArrayLength(env, val) == 32);
37117 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37118 UpdateFulfillHTLC_set_payment_preimage(&this_ptr_conv, val_ref);
37121 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) {
37122 LDKThirtyTwoBytes channel_id_arg_ref;
37123 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
37124 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
37125 LDKThirtyTwoBytes payment_preimage_arg_ref;
37126 CHECK((*env)->GetArrayLength(env, payment_preimage_arg) == 32);
37127 (*env)->GetByteArrayRegion(env, payment_preimage_arg, 0, 32, payment_preimage_arg_ref.data);
37128 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref);
37129 int64_t ret_ref = 0;
37130 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37131 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37135 static inline uint64_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) {
37136 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg);
37137 int64_t ret_ref = 0;
37138 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37139 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37142 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37143 LDKUpdateFulfillHTLC arg_conv;
37144 arg_conv.inner = untag_ptr(arg);
37145 arg_conv.is_owned = ptr_is_owned(arg);
37146 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37147 arg_conv.is_owned = false;
37148 int64_t ret_conv = UpdateFulfillHTLC_clone_ptr(&arg_conv);
37152 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37153 LDKUpdateFulfillHTLC orig_conv;
37154 orig_conv.inner = untag_ptr(orig);
37155 orig_conv.is_owned = ptr_is_owned(orig);
37156 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37157 orig_conv.is_owned = false;
37158 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv);
37159 int64_t ret_ref = 0;
37160 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37161 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37165 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37166 LDKUpdateFulfillHTLC a_conv;
37167 a_conv.inner = untag_ptr(a);
37168 a_conv.is_owned = ptr_is_owned(a);
37169 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37170 a_conv.is_owned = false;
37171 LDKUpdateFulfillHTLC b_conv;
37172 b_conv.inner = untag_ptr(b);
37173 b_conv.is_owned = ptr_is_owned(b);
37174 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37175 b_conv.is_owned = false;
37176 jboolean ret_conv = UpdateFulfillHTLC_eq(&a_conv, &b_conv);
37180 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37181 LDKUpdateFailHTLC this_obj_conv;
37182 this_obj_conv.inner = untag_ptr(this_obj);
37183 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37184 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37185 UpdateFailHTLC_free(this_obj_conv);
37188 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37189 LDKUpdateFailHTLC this_ptr_conv;
37190 this_ptr_conv.inner = untag_ptr(this_ptr);
37191 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37192 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37193 this_ptr_conv.is_owned = false;
37194 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37195 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(&this_ptr_conv));
37199 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37200 LDKUpdateFailHTLC this_ptr_conv;
37201 this_ptr_conv.inner = untag_ptr(this_ptr);
37202 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37203 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37204 this_ptr_conv.is_owned = false;
37205 LDKThirtyTwoBytes val_ref;
37206 CHECK((*env)->GetArrayLength(env, val) == 32);
37207 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37208 UpdateFailHTLC_set_channel_id(&this_ptr_conv, val_ref);
37211 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37212 LDKUpdateFailHTLC this_ptr_conv;
37213 this_ptr_conv.inner = untag_ptr(this_ptr);
37214 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37215 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37216 this_ptr_conv.is_owned = false;
37217 int64_t ret_conv = UpdateFailHTLC_get_htlc_id(&this_ptr_conv);
37221 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
37222 LDKUpdateFailHTLC this_ptr_conv;
37223 this_ptr_conv.inner = untag_ptr(this_ptr);
37224 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37225 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37226 this_ptr_conv.is_owned = false;
37227 UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val);
37230 static inline uint64_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) {
37231 LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg);
37232 int64_t ret_ref = 0;
37233 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37234 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37237 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37238 LDKUpdateFailHTLC arg_conv;
37239 arg_conv.inner = untag_ptr(arg);
37240 arg_conv.is_owned = ptr_is_owned(arg);
37241 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37242 arg_conv.is_owned = false;
37243 int64_t ret_conv = UpdateFailHTLC_clone_ptr(&arg_conv);
37247 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37248 LDKUpdateFailHTLC orig_conv;
37249 orig_conv.inner = untag_ptr(orig);
37250 orig_conv.is_owned = ptr_is_owned(orig);
37251 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37252 orig_conv.is_owned = false;
37253 LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv);
37254 int64_t ret_ref = 0;
37255 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37256 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37260 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37261 LDKUpdateFailHTLC a_conv;
37262 a_conv.inner = untag_ptr(a);
37263 a_conv.is_owned = ptr_is_owned(a);
37264 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37265 a_conv.is_owned = false;
37266 LDKUpdateFailHTLC b_conv;
37267 b_conv.inner = untag_ptr(b);
37268 b_conv.is_owned = ptr_is_owned(b);
37269 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37270 b_conv.is_owned = false;
37271 jboolean ret_conv = UpdateFailHTLC_eq(&a_conv, &b_conv);
37275 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37276 LDKUpdateFailMalformedHTLC this_obj_conv;
37277 this_obj_conv.inner = untag_ptr(this_obj);
37278 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37279 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37280 UpdateFailMalformedHTLC_free(this_obj_conv);
37283 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37284 LDKUpdateFailMalformedHTLC this_ptr_conv;
37285 this_ptr_conv.inner = untag_ptr(this_ptr);
37286 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37287 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37288 this_ptr_conv.is_owned = false;
37289 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37290 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv));
37294 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37295 LDKUpdateFailMalformedHTLC this_ptr_conv;
37296 this_ptr_conv.inner = untag_ptr(this_ptr);
37297 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37298 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37299 this_ptr_conv.is_owned = false;
37300 LDKThirtyTwoBytes val_ref;
37301 CHECK((*env)->GetArrayLength(env, val) == 32);
37302 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37303 UpdateFailMalformedHTLC_set_channel_id(&this_ptr_conv, val_ref);
37306 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37307 LDKUpdateFailMalformedHTLC this_ptr_conv;
37308 this_ptr_conv.inner = untag_ptr(this_ptr);
37309 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37310 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37311 this_ptr_conv.is_owned = false;
37312 int64_t ret_conv = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv);
37316 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
37317 LDKUpdateFailMalformedHTLC 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 UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val);
37325 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr) {
37326 LDKUpdateFailMalformedHTLC this_ptr_conv;
37327 this_ptr_conv.inner = untag_ptr(this_ptr);
37328 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37329 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37330 this_ptr_conv.is_owned = false;
37331 int16_t ret_conv = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv);
37335 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
37336 LDKUpdateFailMalformedHTLC this_ptr_conv;
37337 this_ptr_conv.inner = untag_ptr(this_ptr);
37338 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37339 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37340 this_ptr_conv.is_owned = false;
37341 UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val);
37344 static inline uint64_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) {
37345 LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg);
37346 int64_t ret_ref = 0;
37347 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37348 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37351 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37352 LDKUpdateFailMalformedHTLC arg_conv;
37353 arg_conv.inner = untag_ptr(arg);
37354 arg_conv.is_owned = ptr_is_owned(arg);
37355 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37356 arg_conv.is_owned = false;
37357 int64_t ret_conv = UpdateFailMalformedHTLC_clone_ptr(&arg_conv);
37361 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37362 LDKUpdateFailMalformedHTLC orig_conv;
37363 orig_conv.inner = untag_ptr(orig);
37364 orig_conv.is_owned = ptr_is_owned(orig);
37365 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37366 orig_conv.is_owned = false;
37367 LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv);
37368 int64_t ret_ref = 0;
37369 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37370 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37374 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37375 LDKUpdateFailMalformedHTLC a_conv;
37376 a_conv.inner = untag_ptr(a);
37377 a_conv.is_owned = ptr_is_owned(a);
37378 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37379 a_conv.is_owned = false;
37380 LDKUpdateFailMalformedHTLC b_conv;
37381 b_conv.inner = untag_ptr(b);
37382 b_conv.is_owned = ptr_is_owned(b);
37383 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37384 b_conv.is_owned = false;
37385 jboolean ret_conv = UpdateFailMalformedHTLC_eq(&a_conv, &b_conv);
37389 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37390 LDKCommitmentSigned this_obj_conv;
37391 this_obj_conv.inner = untag_ptr(this_obj);
37392 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37393 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37394 CommitmentSigned_free(this_obj_conv);
37397 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37398 LDKCommitmentSigned this_ptr_conv;
37399 this_ptr_conv.inner = untag_ptr(this_ptr);
37400 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37401 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37402 this_ptr_conv.is_owned = false;
37403 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37404 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(&this_ptr_conv));
37408 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37409 LDKCommitmentSigned this_ptr_conv;
37410 this_ptr_conv.inner = untag_ptr(this_ptr);
37411 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37412 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37413 this_ptr_conv.is_owned = false;
37414 LDKThirtyTwoBytes val_ref;
37415 CHECK((*env)->GetArrayLength(env, val) == 32);
37416 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37417 CommitmentSigned_set_channel_id(&this_ptr_conv, val_ref);
37420 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
37421 LDKCommitmentSigned this_ptr_conv;
37422 this_ptr_conv.inner = untag_ptr(this_ptr);
37423 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37424 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37425 this_ptr_conv.is_owned = false;
37426 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
37427 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, CommitmentSigned_get_signature(&this_ptr_conv).compact_form);
37431 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37432 LDKCommitmentSigned this_ptr_conv;
37433 this_ptr_conv.inner = untag_ptr(this_ptr);
37434 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37435 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37436 this_ptr_conv.is_owned = false;
37437 LDKSignature val_ref;
37438 CHECK((*env)->GetArrayLength(env, val) == 64);
37439 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
37440 CommitmentSigned_set_signature(&this_ptr_conv, val_ref);
37443 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1htlc_1signatures(JNIEnv *env, jclass clz, int64_t this_ptr) {
37444 LDKCommitmentSigned this_ptr_conv;
37445 this_ptr_conv.inner = untag_ptr(this_ptr);
37446 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37447 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37448 this_ptr_conv.is_owned = false;
37449 LDKCVec_SignatureZ ret_var = CommitmentSigned_get_htlc_signatures(&this_ptr_conv);
37450 jobjectArray ret_arr = NULL;
37451 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
37453 for (size_t i = 0; i < ret_var.datalen; i++) {
37454 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64);
37455 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form);
37456 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
37459 FREE(ret_var.data);
37463 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) {
37464 LDKCommitmentSigned this_ptr_conv;
37465 this_ptr_conv.inner = untag_ptr(this_ptr);
37466 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37467 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37468 this_ptr_conv.is_owned = false;
37469 LDKCVec_SignatureZ val_constr;
37470 val_constr.datalen = (*env)->GetArrayLength(env, val);
37471 if (val_constr.datalen > 0)
37472 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
37474 val_constr.data = NULL;
37475 for (size_t i = 0; i < val_constr.datalen; i++) {
37476 int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i);
37477 LDKSignature val_conv_8_ref;
37478 CHECK((*env)->GetArrayLength(env, val_conv_8) == 64);
37479 (*env)->GetByteArrayRegion(env, val_conv_8, 0, 64, val_conv_8_ref.compact_form);
37480 val_constr.data[i] = val_conv_8_ref;
37482 CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr);
37485 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) {
37486 LDKThirtyTwoBytes channel_id_arg_ref;
37487 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
37488 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
37489 LDKSignature signature_arg_ref;
37490 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
37491 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
37492 LDKCVec_SignatureZ htlc_signatures_arg_constr;
37493 htlc_signatures_arg_constr.datalen = (*env)->GetArrayLength(env, htlc_signatures_arg);
37494 if (htlc_signatures_arg_constr.datalen > 0)
37495 htlc_signatures_arg_constr.data = MALLOC(htlc_signatures_arg_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
37497 htlc_signatures_arg_constr.data = NULL;
37498 for (size_t i = 0; i < htlc_signatures_arg_constr.datalen; i++) {
37499 int8_tArray htlc_signatures_arg_conv_8 = (*env)->GetObjectArrayElement(env, htlc_signatures_arg, i);
37500 LDKSignature htlc_signatures_arg_conv_8_ref;
37501 CHECK((*env)->GetArrayLength(env, htlc_signatures_arg_conv_8) == 64);
37502 (*env)->GetByteArrayRegion(env, htlc_signatures_arg_conv_8, 0, 64, htlc_signatures_arg_conv_8_ref.compact_form);
37503 htlc_signatures_arg_constr.data[i] = htlc_signatures_arg_conv_8_ref;
37505 LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr);
37506 int64_t ret_ref = 0;
37507 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37508 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37512 static inline uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) {
37513 LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg);
37514 int64_t ret_ref = 0;
37515 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37516 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37519 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37520 LDKCommitmentSigned arg_conv;
37521 arg_conv.inner = untag_ptr(arg);
37522 arg_conv.is_owned = ptr_is_owned(arg);
37523 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37524 arg_conv.is_owned = false;
37525 int64_t ret_conv = CommitmentSigned_clone_ptr(&arg_conv);
37529 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37530 LDKCommitmentSigned orig_conv;
37531 orig_conv.inner = untag_ptr(orig);
37532 orig_conv.is_owned = ptr_is_owned(orig);
37533 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37534 orig_conv.is_owned = false;
37535 LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv);
37536 int64_t ret_ref = 0;
37537 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37538 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37542 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37543 LDKCommitmentSigned a_conv;
37544 a_conv.inner = untag_ptr(a);
37545 a_conv.is_owned = ptr_is_owned(a);
37546 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37547 a_conv.is_owned = false;
37548 LDKCommitmentSigned b_conv;
37549 b_conv.inner = untag_ptr(b);
37550 b_conv.is_owned = ptr_is_owned(b);
37551 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37552 b_conv.is_owned = false;
37553 jboolean ret_conv = CommitmentSigned_eq(&a_conv, &b_conv);
37557 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37558 LDKRevokeAndACK this_obj_conv;
37559 this_obj_conv.inner = untag_ptr(this_obj);
37560 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37561 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37562 RevokeAndACK_free(this_obj_conv);
37565 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37566 LDKRevokeAndACK this_ptr_conv;
37567 this_ptr_conv.inner = untag_ptr(this_ptr);
37568 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37569 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37570 this_ptr_conv.is_owned = false;
37571 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37572 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(&this_ptr_conv));
37576 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37577 LDKRevokeAndACK this_ptr_conv;
37578 this_ptr_conv.inner = untag_ptr(this_ptr);
37579 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37580 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37581 this_ptr_conv.is_owned = false;
37582 LDKThirtyTwoBytes val_ref;
37583 CHECK((*env)->GetArrayLength(env, val) == 32);
37584 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37585 RevokeAndACK_set_channel_id(&this_ptr_conv, val_ref);
37588 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) {
37589 LDKRevokeAndACK this_ptr_conv;
37590 this_ptr_conv.inner = untag_ptr(this_ptr);
37591 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37592 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37593 this_ptr_conv.is_owned = false;
37594 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37595 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv));
37599 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37600 LDKRevokeAndACK this_ptr_conv;
37601 this_ptr_conv.inner = untag_ptr(this_ptr);
37602 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37603 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37604 this_ptr_conv.is_owned = false;
37605 LDKThirtyTwoBytes val_ref;
37606 CHECK((*env)->GetArrayLength(env, val) == 32);
37607 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37608 RevokeAndACK_set_per_commitment_secret(&this_ptr_conv, val_ref);
37611 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
37612 LDKRevokeAndACK this_ptr_conv;
37613 this_ptr_conv.inner = untag_ptr(this_ptr);
37614 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37615 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37616 this_ptr_conv.is_owned = false;
37617 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
37618 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form);
37622 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) {
37623 LDKRevokeAndACK this_ptr_conv;
37624 this_ptr_conv.inner = untag_ptr(this_ptr);
37625 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37626 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37627 this_ptr_conv.is_owned = false;
37628 LDKPublicKey val_ref;
37629 CHECK((*env)->GetArrayLength(env, val) == 33);
37630 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
37631 RevokeAndACK_set_next_per_commitment_point(&this_ptr_conv, val_ref);
37634 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) {
37635 LDKThirtyTwoBytes channel_id_arg_ref;
37636 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
37637 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
37638 LDKThirtyTwoBytes per_commitment_secret_arg_ref;
37639 CHECK((*env)->GetArrayLength(env, per_commitment_secret_arg) == 32);
37640 (*env)->GetByteArrayRegion(env, per_commitment_secret_arg, 0, 32, per_commitment_secret_arg_ref.data);
37641 LDKPublicKey next_per_commitment_point_arg_ref;
37642 CHECK((*env)->GetArrayLength(env, next_per_commitment_point_arg) == 33);
37643 (*env)->GetByteArrayRegion(env, next_per_commitment_point_arg, 0, 33, next_per_commitment_point_arg_ref.compressed_form);
37644 LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref);
37645 int64_t ret_ref = 0;
37646 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37647 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37651 static inline uint64_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) {
37652 LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg);
37653 int64_t ret_ref = 0;
37654 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37655 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37658 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37659 LDKRevokeAndACK arg_conv;
37660 arg_conv.inner = untag_ptr(arg);
37661 arg_conv.is_owned = ptr_is_owned(arg);
37662 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37663 arg_conv.is_owned = false;
37664 int64_t ret_conv = RevokeAndACK_clone_ptr(&arg_conv);
37668 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37669 LDKRevokeAndACK orig_conv;
37670 orig_conv.inner = untag_ptr(orig);
37671 orig_conv.is_owned = ptr_is_owned(orig);
37672 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37673 orig_conv.is_owned = false;
37674 LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv);
37675 int64_t ret_ref = 0;
37676 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37677 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37681 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37682 LDKRevokeAndACK a_conv;
37683 a_conv.inner = untag_ptr(a);
37684 a_conv.is_owned = ptr_is_owned(a);
37685 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37686 a_conv.is_owned = false;
37687 LDKRevokeAndACK b_conv;
37688 b_conv.inner = untag_ptr(b);
37689 b_conv.is_owned = ptr_is_owned(b);
37690 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37691 b_conv.is_owned = false;
37692 jboolean ret_conv = RevokeAndACK_eq(&a_conv, &b_conv);
37696 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37697 LDKUpdateFee this_obj_conv;
37698 this_obj_conv.inner = untag_ptr(this_obj);
37699 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37700 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37701 UpdateFee_free(this_obj_conv);
37704 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37705 LDKUpdateFee this_ptr_conv;
37706 this_ptr_conv.inner = untag_ptr(this_ptr);
37707 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37708 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37709 this_ptr_conv.is_owned = false;
37710 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37711 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UpdateFee_get_channel_id(&this_ptr_conv));
37715 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37716 LDKUpdateFee this_ptr_conv;
37717 this_ptr_conv.inner = untag_ptr(this_ptr);
37718 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37719 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37720 this_ptr_conv.is_owned = false;
37721 LDKThirtyTwoBytes val_ref;
37722 CHECK((*env)->GetArrayLength(env, val) == 32);
37723 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37724 UpdateFee_set_channel_id(&this_ptr_conv, val_ref);
37727 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr) {
37728 LDKUpdateFee this_ptr_conv;
37729 this_ptr_conv.inner = untag_ptr(this_ptr);
37730 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37731 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37732 this_ptr_conv.is_owned = false;
37733 int32_t ret_conv = UpdateFee_get_feerate_per_kw(&this_ptr_conv);
37737 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
37738 LDKUpdateFee this_ptr_conv;
37739 this_ptr_conv.inner = untag_ptr(this_ptr);
37740 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37741 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37742 this_ptr_conv.is_owned = false;
37743 UpdateFee_set_feerate_per_kw(&this_ptr_conv, val);
37746 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) {
37747 LDKThirtyTwoBytes channel_id_arg_ref;
37748 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
37749 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
37750 LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_arg);
37751 int64_t ret_ref = 0;
37752 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37753 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37757 static inline uint64_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) {
37758 LDKUpdateFee ret_var = UpdateFee_clone(arg);
37759 int64_t ret_ref = 0;
37760 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37761 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37764 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37765 LDKUpdateFee arg_conv;
37766 arg_conv.inner = untag_ptr(arg);
37767 arg_conv.is_owned = ptr_is_owned(arg);
37768 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37769 arg_conv.is_owned = false;
37770 int64_t ret_conv = UpdateFee_clone_ptr(&arg_conv);
37774 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37775 LDKUpdateFee orig_conv;
37776 orig_conv.inner = untag_ptr(orig);
37777 orig_conv.is_owned = ptr_is_owned(orig);
37778 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37779 orig_conv.is_owned = false;
37780 LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv);
37781 int64_t ret_ref = 0;
37782 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37783 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37787 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFee_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37788 LDKUpdateFee a_conv;
37789 a_conv.inner = untag_ptr(a);
37790 a_conv.is_owned = ptr_is_owned(a);
37791 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37792 a_conv.is_owned = false;
37793 LDKUpdateFee b_conv;
37794 b_conv.inner = untag_ptr(b);
37795 b_conv.is_owned = ptr_is_owned(b);
37796 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37797 b_conv.is_owned = false;
37798 jboolean ret_conv = UpdateFee_eq(&a_conv, &b_conv);
37802 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37803 LDKDataLossProtect this_obj_conv;
37804 this_obj_conv.inner = untag_ptr(this_obj);
37805 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37806 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37807 DataLossProtect_free(this_obj_conv);
37810 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) {
37811 LDKDataLossProtect this_ptr_conv;
37812 this_ptr_conv.inner = untag_ptr(this_ptr);
37813 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37814 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37815 this_ptr_conv.is_owned = false;
37816 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37817 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv));
37821 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) {
37822 LDKDataLossProtect this_ptr_conv;
37823 this_ptr_conv.inner = untag_ptr(this_ptr);
37824 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37825 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37826 this_ptr_conv.is_owned = false;
37827 LDKThirtyTwoBytes val_ref;
37828 CHECK((*env)->GetArrayLength(env, val) == 32);
37829 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37830 DataLossProtect_set_your_last_per_commitment_secret(&this_ptr_conv, val_ref);
37833 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
37834 LDKDataLossProtect this_ptr_conv;
37835 this_ptr_conv.inner = untag_ptr(this_ptr);
37836 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37837 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37838 this_ptr_conv.is_owned = false;
37839 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
37840 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form);
37844 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) {
37845 LDKDataLossProtect this_ptr_conv;
37846 this_ptr_conv.inner = untag_ptr(this_ptr);
37847 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37848 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37849 this_ptr_conv.is_owned = false;
37850 LDKPublicKey val_ref;
37851 CHECK((*env)->GetArrayLength(env, val) == 33);
37852 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
37853 DataLossProtect_set_my_current_per_commitment_point(&this_ptr_conv, val_ref);
37856 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) {
37857 LDKThirtyTwoBytes your_last_per_commitment_secret_arg_ref;
37858 CHECK((*env)->GetArrayLength(env, your_last_per_commitment_secret_arg) == 32);
37859 (*env)->GetByteArrayRegion(env, your_last_per_commitment_secret_arg, 0, 32, your_last_per_commitment_secret_arg_ref.data);
37860 LDKPublicKey my_current_per_commitment_point_arg_ref;
37861 CHECK((*env)->GetArrayLength(env, my_current_per_commitment_point_arg) == 33);
37862 (*env)->GetByteArrayRegion(env, my_current_per_commitment_point_arg, 0, 33, my_current_per_commitment_point_arg_ref.compressed_form);
37863 LDKDataLossProtect ret_var = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref);
37864 int64_t ret_ref = 0;
37865 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37866 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37870 static inline uint64_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) {
37871 LDKDataLossProtect ret_var = DataLossProtect_clone(arg);
37872 int64_t ret_ref = 0;
37873 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37874 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37877 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37878 LDKDataLossProtect arg_conv;
37879 arg_conv.inner = untag_ptr(arg);
37880 arg_conv.is_owned = ptr_is_owned(arg);
37881 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37882 arg_conv.is_owned = false;
37883 int64_t ret_conv = DataLossProtect_clone_ptr(&arg_conv);
37887 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone(JNIEnv *env, jclass clz, int64_t orig) {
37888 LDKDataLossProtect orig_conv;
37889 orig_conv.inner = untag_ptr(orig);
37890 orig_conv.is_owned = ptr_is_owned(orig);
37891 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37892 orig_conv.is_owned = false;
37893 LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv);
37894 int64_t ret_ref = 0;
37895 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37896 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37900 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
37901 LDKDataLossProtect a_conv;
37902 a_conv.inner = untag_ptr(a);
37903 a_conv.is_owned = ptr_is_owned(a);
37904 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
37905 a_conv.is_owned = false;
37906 LDKDataLossProtect b_conv;
37907 b_conv.inner = untag_ptr(b);
37908 b_conv.is_owned = ptr_is_owned(b);
37909 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
37910 b_conv.is_owned = false;
37911 jboolean ret_conv = DataLossProtect_eq(&a_conv, &b_conv);
37915 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
37916 LDKChannelReestablish this_obj_conv;
37917 this_obj_conv.inner = untag_ptr(this_obj);
37918 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37919 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37920 ChannelReestablish_free(this_obj_conv);
37923 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
37924 LDKChannelReestablish this_ptr_conv;
37925 this_ptr_conv.inner = untag_ptr(this_ptr);
37926 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37927 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37928 this_ptr_conv.is_owned = false;
37929 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
37930 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(&this_ptr_conv));
37934 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
37935 LDKChannelReestablish this_ptr_conv;
37936 this_ptr_conv.inner = untag_ptr(this_ptr);
37937 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37938 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37939 this_ptr_conv.is_owned = false;
37940 LDKThirtyTwoBytes val_ref;
37941 CHECK((*env)->GetArrayLength(env, val) == 32);
37942 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
37943 ChannelReestablish_set_channel_id(&this_ptr_conv, val_ref);
37946 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) {
37947 LDKChannelReestablish this_ptr_conv;
37948 this_ptr_conv.inner = untag_ptr(this_ptr);
37949 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37950 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37951 this_ptr_conv.is_owned = false;
37952 int64_t ret_conv = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv);
37956 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) {
37957 LDKChannelReestablish 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 ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val);
37965 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_ptr) {
37966 LDKChannelReestablish this_ptr_conv;
37967 this_ptr_conv.inner = untag_ptr(this_ptr);
37968 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37969 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37970 this_ptr_conv.is_owned = false;
37971 int64_t ret_conv = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv);
37975 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) {
37976 LDKChannelReestablish this_ptr_conv;
37977 this_ptr_conv.inner = untag_ptr(this_ptr);
37978 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37979 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37980 this_ptr_conv.is_owned = false;
37981 ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val);
37984 static inline uint64_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) {
37985 LDKChannelReestablish ret_var = ChannelReestablish_clone(arg);
37986 int64_t ret_ref = 0;
37987 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37988 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37991 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
37992 LDKChannelReestablish arg_conv;
37993 arg_conv.inner = untag_ptr(arg);
37994 arg_conv.is_owned = ptr_is_owned(arg);
37995 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37996 arg_conv.is_owned = false;
37997 int64_t ret_conv = ChannelReestablish_clone_ptr(&arg_conv);
38001 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38002 LDKChannelReestablish orig_conv;
38003 orig_conv.inner = untag_ptr(orig);
38004 orig_conv.is_owned = ptr_is_owned(orig);
38005 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38006 orig_conv.is_owned = false;
38007 LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv);
38008 int64_t ret_ref = 0;
38009 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38010 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38014 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
38015 LDKChannelReestablish a_conv;
38016 a_conv.inner = untag_ptr(a);
38017 a_conv.is_owned = ptr_is_owned(a);
38018 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38019 a_conv.is_owned = false;
38020 LDKChannelReestablish b_conv;
38021 b_conv.inner = untag_ptr(b);
38022 b_conv.is_owned = ptr_is_owned(b);
38023 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38024 b_conv.is_owned = false;
38025 jboolean ret_conv = ChannelReestablish_eq(&a_conv, &b_conv);
38029 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38030 LDKAnnouncementSignatures this_obj_conv;
38031 this_obj_conv.inner = untag_ptr(this_obj);
38032 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38033 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38034 AnnouncementSignatures_free(this_obj_conv);
38037 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
38038 LDKAnnouncementSignatures this_ptr_conv;
38039 this_ptr_conv.inner = untag_ptr(this_ptr);
38040 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38041 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38042 this_ptr_conv.is_owned = false;
38043 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
38044 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(&this_ptr_conv));
38048 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38049 LDKAnnouncementSignatures this_ptr_conv;
38050 this_ptr_conv.inner = untag_ptr(this_ptr);
38051 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38052 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38053 this_ptr_conv.is_owned = false;
38054 LDKThirtyTwoBytes val_ref;
38055 CHECK((*env)->GetArrayLength(env, val) == 32);
38056 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
38057 AnnouncementSignatures_set_channel_id(&this_ptr_conv, val_ref);
38060 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
38061 LDKAnnouncementSignatures this_ptr_conv;
38062 this_ptr_conv.inner = untag_ptr(this_ptr);
38063 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38064 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38065 this_ptr_conv.is_owned = false;
38066 int64_t ret_conv = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv);
38070 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38071 LDKAnnouncementSignatures this_ptr_conv;
38072 this_ptr_conv.inner = untag_ptr(this_ptr);
38073 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38074 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38075 this_ptr_conv.is_owned = false;
38076 AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val);
38079 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
38080 LDKAnnouncementSignatures this_ptr_conv;
38081 this_ptr_conv.inner = untag_ptr(this_ptr);
38082 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38083 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38084 this_ptr_conv.is_owned = false;
38085 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
38086 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form);
38090 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38091 LDKAnnouncementSignatures this_ptr_conv;
38092 this_ptr_conv.inner = untag_ptr(this_ptr);
38093 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38094 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38095 this_ptr_conv.is_owned = false;
38096 LDKSignature val_ref;
38097 CHECK((*env)->GetArrayLength(env, val) == 64);
38098 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
38099 AnnouncementSignatures_set_node_signature(&this_ptr_conv, val_ref);
38102 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
38103 LDKAnnouncementSignatures this_ptr_conv;
38104 this_ptr_conv.inner = untag_ptr(this_ptr);
38105 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38106 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38107 this_ptr_conv.is_owned = false;
38108 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
38109 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form);
38113 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38114 LDKAnnouncementSignatures this_ptr_conv;
38115 this_ptr_conv.inner = untag_ptr(this_ptr);
38116 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38117 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38118 this_ptr_conv.is_owned = false;
38119 LDKSignature val_ref;
38120 CHECK((*env)->GetArrayLength(env, val) == 64);
38121 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
38122 AnnouncementSignatures_set_bitcoin_signature(&this_ptr_conv, val_ref);
38125 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) {
38126 LDKThirtyTwoBytes channel_id_arg_ref;
38127 CHECK((*env)->GetArrayLength(env, channel_id_arg) == 32);
38128 (*env)->GetByteArrayRegion(env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
38129 LDKSignature node_signature_arg_ref;
38130 CHECK((*env)->GetArrayLength(env, node_signature_arg) == 64);
38131 (*env)->GetByteArrayRegion(env, node_signature_arg, 0, 64, node_signature_arg_ref.compact_form);
38132 LDKSignature bitcoin_signature_arg_ref;
38133 CHECK((*env)->GetArrayLength(env, bitcoin_signature_arg) == 64);
38134 (*env)->GetByteArrayRegion(env, bitcoin_signature_arg, 0, 64, bitcoin_signature_arg_ref.compact_form);
38135 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref);
38136 int64_t ret_ref = 0;
38137 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38138 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38142 static inline uint64_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) {
38143 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg);
38144 int64_t ret_ref = 0;
38145 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38146 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38149 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38150 LDKAnnouncementSignatures arg_conv;
38151 arg_conv.inner = untag_ptr(arg);
38152 arg_conv.is_owned = ptr_is_owned(arg);
38153 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38154 arg_conv.is_owned = false;
38155 int64_t ret_conv = AnnouncementSignatures_clone_ptr(&arg_conv);
38159 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38160 LDKAnnouncementSignatures orig_conv;
38161 orig_conv.inner = untag_ptr(orig);
38162 orig_conv.is_owned = ptr_is_owned(orig);
38163 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38164 orig_conv.is_owned = false;
38165 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv);
38166 int64_t ret_ref = 0;
38167 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38168 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38172 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
38173 LDKAnnouncementSignatures a_conv;
38174 a_conv.inner = untag_ptr(a);
38175 a_conv.is_owned = ptr_is_owned(a);
38176 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38177 a_conv.is_owned = false;
38178 LDKAnnouncementSignatures b_conv;
38179 b_conv.inner = untag_ptr(b);
38180 b_conv.is_owned = ptr_is_owned(b);
38181 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38182 b_conv.is_owned = false;
38183 jboolean ret_conv = AnnouncementSignatures_eq(&a_conv, &b_conv);
38187 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
38188 if (!ptr_is_owned(this_ptr)) return;
38189 void* this_ptr_ptr = untag_ptr(this_ptr);
38190 CHECK_ACCESS(this_ptr_ptr);
38191 LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(this_ptr_ptr);
38192 FREE(untag_ptr(this_ptr));
38193 NetAddress_free(this_ptr_conv);
38196 static inline uint64_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) {
38197 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
38198 *ret_copy = NetAddress_clone(arg);
38199 int64_t ret_ref = tag_ptr(ret_copy, true);
38202 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38203 LDKNetAddress* arg_conv = (LDKNetAddress*)untag_ptr(arg);
38204 int64_t ret_conv = NetAddress_clone_ptr(arg_conv);
38208 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38209 LDKNetAddress* orig_conv = (LDKNetAddress*)untag_ptr(orig);
38210 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
38211 *ret_copy = NetAddress_clone(orig_conv);
38212 int64_t ret_ref = tag_ptr(ret_copy, true);
38216 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv4(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) {
38217 LDKFourBytes addr_ref;
38218 CHECK((*env)->GetArrayLength(env, addr) == 4);
38219 (*env)->GetByteArrayRegion(env, addr, 0, 4, addr_ref.data);
38220 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
38221 *ret_copy = NetAddress_ipv4(addr_ref, port);
38222 int64_t ret_ref = tag_ptr(ret_copy, true);
38226 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv6(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) {
38227 LDKSixteenBytes addr_ref;
38228 CHECK((*env)->GetArrayLength(env, addr) == 16);
38229 (*env)->GetByteArrayRegion(env, addr, 0, 16, addr_ref.data);
38230 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
38231 *ret_copy = NetAddress_ipv6(addr_ref, port);
38232 int64_t ret_ref = tag_ptr(ret_copy, true);
38236 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v2(JNIEnv *env, jclass clz, int8_tArray a) {
38237 LDKTwelveBytes a_ref;
38238 CHECK((*env)->GetArrayLength(env, a) == 12);
38239 (*env)->GetByteArrayRegion(env, a, 0, 12, a_ref.data);
38240 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
38241 *ret_copy = NetAddress_onion_v2(a_ref);
38242 int64_t ret_ref = tag_ptr(ret_copy, true);
38246 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) {
38247 LDKThirtyTwoBytes ed25519_pubkey_ref;
38248 CHECK((*env)->GetArrayLength(env, ed25519_pubkey) == 32);
38249 (*env)->GetByteArrayRegion(env, ed25519_pubkey, 0, 32, ed25519_pubkey_ref.data);
38250 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
38251 *ret_copy = NetAddress_onion_v3(ed25519_pubkey_ref, checksum, version, port);
38252 int64_t ret_ref = tag_ptr(ret_copy, true);
38256 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1hostname(JNIEnv *env, jclass clz, int64_t hostname, int16_t port) {
38257 LDKHostname hostname_conv;
38258 hostname_conv.inner = untag_ptr(hostname);
38259 hostname_conv.is_owned = ptr_is_owned(hostname);
38260 CHECK_INNER_FIELD_ACCESS_OR_NULL(hostname_conv);
38261 hostname_conv = Hostname_clone(&hostname_conv);
38262 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
38263 *ret_copy = NetAddress_hostname(hostname_conv, port);
38264 int64_t ret_ref = tag_ptr(ret_copy, true);
38268 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NetAddress_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
38269 LDKNetAddress* a_conv = (LDKNetAddress*)untag_ptr(a);
38270 LDKNetAddress* b_conv = (LDKNetAddress*)untag_ptr(b);
38271 jboolean ret_conv = NetAddress_eq(a_conv, b_conv);
38275 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetAddress_1write(JNIEnv *env, jclass clz, int64_t obj) {
38276 LDKNetAddress* obj_conv = (LDKNetAddress*)untag_ptr(obj);
38277 LDKCVec_u8Z ret_var = NetAddress_write(obj_conv);
38278 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
38279 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
38280 CVec_u8Z_free(ret_var);
38284 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
38285 LDKu8slice ser_ref;
38286 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
38287 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
38288 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
38289 *ret_conv = NetAddress_read(ser_ref);
38290 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
38291 return tag_ptr(ret_conv, true);
38294 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedGossipMessage_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
38295 if (!ptr_is_owned(this_ptr)) return;
38296 void* this_ptr_ptr = untag_ptr(this_ptr);
38297 CHECK_ACCESS(this_ptr_ptr);
38298 LDKUnsignedGossipMessage this_ptr_conv = *(LDKUnsignedGossipMessage*)(this_ptr_ptr);
38299 FREE(untag_ptr(this_ptr));
38300 UnsignedGossipMessage_free(this_ptr_conv);
38303 static inline uint64_t UnsignedGossipMessage_clone_ptr(LDKUnsignedGossipMessage *NONNULL_PTR arg) {
38304 LDKUnsignedGossipMessage *ret_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage");
38305 *ret_copy = UnsignedGossipMessage_clone(arg);
38306 int64_t ret_ref = tag_ptr(ret_copy, true);
38309 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedGossipMessage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38310 LDKUnsignedGossipMessage* arg_conv = (LDKUnsignedGossipMessage*)untag_ptr(arg);
38311 int64_t ret_conv = UnsignedGossipMessage_clone_ptr(arg_conv);
38315 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedGossipMessage_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38316 LDKUnsignedGossipMessage* orig_conv = (LDKUnsignedGossipMessage*)untag_ptr(orig);
38317 LDKUnsignedGossipMessage *ret_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage");
38318 *ret_copy = UnsignedGossipMessage_clone(orig_conv);
38319 int64_t ret_ref = tag_ptr(ret_copy, true);
38323 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedGossipMessage_1channel_1announcement(JNIEnv *env, jclass clz, int64_t a) {
38324 LDKUnsignedChannelAnnouncement a_conv;
38325 a_conv.inner = untag_ptr(a);
38326 a_conv.is_owned = ptr_is_owned(a);
38327 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38328 a_conv = UnsignedChannelAnnouncement_clone(&a_conv);
38329 LDKUnsignedGossipMessage *ret_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage");
38330 *ret_copy = UnsignedGossipMessage_channel_announcement(a_conv);
38331 int64_t ret_ref = tag_ptr(ret_copy, true);
38335 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedGossipMessage_1channel_1update(JNIEnv *env, jclass clz, int64_t a) {
38336 LDKUnsignedChannelUpdate a_conv;
38337 a_conv.inner = untag_ptr(a);
38338 a_conv.is_owned = ptr_is_owned(a);
38339 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38340 a_conv = UnsignedChannelUpdate_clone(&a_conv);
38341 LDKUnsignedGossipMessage *ret_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage");
38342 *ret_copy = UnsignedGossipMessage_channel_update(a_conv);
38343 int64_t ret_ref = tag_ptr(ret_copy, true);
38347 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedGossipMessage_1node_1announcement(JNIEnv *env, jclass clz, int64_t a) {
38348 LDKUnsignedNodeAnnouncement a_conv;
38349 a_conv.inner = untag_ptr(a);
38350 a_conv.is_owned = ptr_is_owned(a);
38351 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38352 a_conv = UnsignedNodeAnnouncement_clone(&a_conv);
38353 LDKUnsignedGossipMessage *ret_copy = MALLOC(sizeof(LDKUnsignedGossipMessage), "LDKUnsignedGossipMessage");
38354 *ret_copy = UnsignedGossipMessage_node_announcement(a_conv);
38355 int64_t ret_ref = tag_ptr(ret_copy, true);
38359 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedGossipMessage_1write(JNIEnv *env, jclass clz, int64_t obj) {
38360 LDKUnsignedGossipMessage* obj_conv = (LDKUnsignedGossipMessage*)untag_ptr(obj);
38361 LDKCVec_u8Z ret_var = UnsignedGossipMessage_write(obj_conv);
38362 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
38363 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
38364 CVec_u8Z_free(ret_var);
38368 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38369 LDKUnsignedNodeAnnouncement this_obj_conv;
38370 this_obj_conv.inner = untag_ptr(this_obj);
38371 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38372 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38373 UnsignedNodeAnnouncement_free(this_obj_conv);
38376 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
38377 LDKUnsignedNodeAnnouncement this_ptr_conv;
38378 this_ptr_conv.inner = untag_ptr(this_ptr);
38379 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38380 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38381 this_ptr_conv.is_owned = false;
38382 LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv);
38383 int64_t ret_ref = 0;
38384 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38385 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38389 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38390 LDKUnsignedNodeAnnouncement this_ptr_conv;
38391 this_ptr_conv.inner = untag_ptr(this_ptr);
38392 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38393 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38394 this_ptr_conv.is_owned = false;
38395 LDKNodeFeatures val_conv;
38396 val_conv.inner = untag_ptr(val);
38397 val_conv.is_owned = ptr_is_owned(val);
38398 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38399 val_conv = NodeFeatures_clone(&val_conv);
38400 UnsignedNodeAnnouncement_set_features(&this_ptr_conv, val_conv);
38403 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) {
38404 LDKUnsignedNodeAnnouncement this_ptr_conv;
38405 this_ptr_conv.inner = untag_ptr(this_ptr);
38406 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38407 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38408 this_ptr_conv.is_owned = false;
38409 int32_t ret_conv = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv);
38413 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
38414 LDKUnsignedNodeAnnouncement this_ptr_conv;
38415 this_ptr_conv.inner = untag_ptr(this_ptr);
38416 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38417 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38418 this_ptr_conv.is_owned = false;
38419 UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val);
38422 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
38423 LDKUnsignedNodeAnnouncement this_ptr_conv;
38424 this_ptr_conv.inner = untag_ptr(this_ptr);
38425 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38426 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38427 this_ptr_conv.is_owned = false;
38428 LDKNodeId ret_var = UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv);
38429 int64_t ret_ref = 0;
38430 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38431 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38435 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t 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 LDKNodeId val_conv;
38442 val_conv.inner = untag_ptr(val);
38443 val_conv.is_owned = ptr_is_owned(val);
38444 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38445 val_conv = NodeId_clone(&val_conv);
38446 UnsignedNodeAnnouncement_set_node_id(&this_ptr_conv, val_conv);
38449 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr) {
38450 LDKUnsignedNodeAnnouncement this_ptr_conv;
38451 this_ptr_conv.inner = untag_ptr(this_ptr);
38452 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38453 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38454 this_ptr_conv.is_owned = false;
38455 int8_tArray ret_arr = (*env)->NewByteArray(env, 3);
38456 (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv));
38460 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38461 LDKUnsignedNodeAnnouncement this_ptr_conv;
38462 this_ptr_conv.inner = untag_ptr(this_ptr);
38463 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38464 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38465 this_ptr_conv.is_owned = false;
38466 LDKThreeBytes val_ref;
38467 CHECK((*env)->GetArrayLength(env, val) == 3);
38468 (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data);
38469 UnsignedNodeAnnouncement_set_rgb(&this_ptr_conv, val_ref);
38472 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) {
38473 LDKUnsignedNodeAnnouncement this_ptr_conv;
38474 this_ptr_conv.inner = untag_ptr(this_ptr);
38475 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38476 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38477 this_ptr_conv.is_owned = false;
38478 LDKNodeAlias ret_var = UnsignedNodeAnnouncement_get_alias(&this_ptr_conv);
38479 int64_t ret_ref = 0;
38480 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38481 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38485 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38486 LDKUnsignedNodeAnnouncement this_ptr_conv;
38487 this_ptr_conv.inner = untag_ptr(this_ptr);
38488 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38489 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38490 this_ptr_conv.is_owned = false;
38491 LDKNodeAlias val_conv;
38492 val_conv.inner = untag_ptr(val);
38493 val_conv.is_owned = ptr_is_owned(val);
38494 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38495 val_conv = NodeAlias_clone(&val_conv);
38496 UnsignedNodeAnnouncement_set_alias(&this_ptr_conv, val_conv);
38499 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr) {
38500 LDKUnsignedNodeAnnouncement this_ptr_conv;
38501 this_ptr_conv.inner = untag_ptr(this_ptr);
38502 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38503 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38504 this_ptr_conv.is_owned = false;
38505 LDKCVec_NetAddressZ ret_var = UnsignedNodeAnnouncement_get_addresses(&this_ptr_conv);
38506 int64_tArray ret_arr = NULL;
38507 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
38508 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
38509 for (size_t m = 0; m < ret_var.datalen; m++) {
38510 LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
38511 *ret_conv_12_copy = ret_var.data[m];
38512 int64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true);
38513 ret_arr_ptr[m] = ret_conv_12_ref;
38515 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
38516 FREE(ret_var.data);
38520 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
38521 LDKUnsignedNodeAnnouncement this_ptr_conv;
38522 this_ptr_conv.inner = untag_ptr(this_ptr);
38523 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38524 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38525 this_ptr_conv.is_owned = false;
38526 LDKCVec_NetAddressZ val_constr;
38527 val_constr.datalen = (*env)->GetArrayLength(env, val);
38528 if (val_constr.datalen > 0)
38529 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
38531 val_constr.data = NULL;
38532 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
38533 for (size_t m = 0; m < val_constr.datalen; m++) {
38534 int64_t val_conv_12 = val_vals[m];
38535 void* val_conv_12_ptr = untag_ptr(val_conv_12);
38536 CHECK_ACCESS(val_conv_12_ptr);
38537 LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
38538 val_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(val_conv_12));
38539 val_constr.data[m] = val_conv_12_conv;
38541 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
38542 UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr);
38545 static inline uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) {
38546 LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg);
38547 int64_t ret_ref = 0;
38548 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38549 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38552 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38553 LDKUnsignedNodeAnnouncement arg_conv;
38554 arg_conv.inner = untag_ptr(arg);
38555 arg_conv.is_owned = ptr_is_owned(arg);
38556 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38557 arg_conv.is_owned = false;
38558 int64_t ret_conv = UnsignedNodeAnnouncement_clone_ptr(&arg_conv);
38562 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38563 LDKUnsignedNodeAnnouncement orig_conv;
38564 orig_conv.inner = untag_ptr(orig);
38565 orig_conv.is_owned = ptr_is_owned(orig);
38566 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38567 orig_conv.is_owned = false;
38568 LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv);
38569 int64_t ret_ref = 0;
38570 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38571 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38575 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
38576 LDKUnsignedNodeAnnouncement a_conv;
38577 a_conv.inner = untag_ptr(a);
38578 a_conv.is_owned = ptr_is_owned(a);
38579 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38580 a_conv.is_owned = false;
38581 LDKUnsignedNodeAnnouncement b_conv;
38582 b_conv.inner = untag_ptr(b);
38583 b_conv.is_owned = ptr_is_owned(b);
38584 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38585 b_conv.is_owned = false;
38586 jboolean ret_conv = UnsignedNodeAnnouncement_eq(&a_conv, &b_conv);
38590 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38591 LDKNodeAnnouncement this_obj_conv;
38592 this_obj_conv.inner = untag_ptr(this_obj);
38593 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38594 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38595 NodeAnnouncement_free(this_obj_conv);
38598 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
38599 LDKNodeAnnouncement this_ptr_conv;
38600 this_ptr_conv.inner = untag_ptr(this_ptr);
38601 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38602 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38603 this_ptr_conv.is_owned = false;
38604 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
38605 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form);
38609 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38610 LDKNodeAnnouncement this_ptr_conv;
38611 this_ptr_conv.inner = untag_ptr(this_ptr);
38612 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38613 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38614 this_ptr_conv.is_owned = false;
38615 LDKSignature val_ref;
38616 CHECK((*env)->GetArrayLength(env, val) == 64);
38617 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
38618 NodeAnnouncement_set_signature(&this_ptr_conv, val_ref);
38621 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) {
38622 LDKNodeAnnouncement this_ptr_conv;
38623 this_ptr_conv.inner = untag_ptr(this_ptr);
38624 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38625 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38626 this_ptr_conv.is_owned = false;
38627 LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv);
38628 int64_t ret_ref = 0;
38629 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38630 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38634 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38635 LDKNodeAnnouncement this_ptr_conv;
38636 this_ptr_conv.inner = untag_ptr(this_ptr);
38637 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38638 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38639 this_ptr_conv.is_owned = false;
38640 LDKUnsignedNodeAnnouncement val_conv;
38641 val_conv.inner = untag_ptr(val);
38642 val_conv.is_owned = ptr_is_owned(val);
38643 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38644 val_conv = UnsignedNodeAnnouncement_clone(&val_conv);
38645 NodeAnnouncement_set_contents(&this_ptr_conv, val_conv);
38648 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEnv *env, jclass clz, int8_tArray signature_arg, int64_t contents_arg) {
38649 LDKSignature signature_arg_ref;
38650 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
38651 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
38652 LDKUnsignedNodeAnnouncement contents_arg_conv;
38653 contents_arg_conv.inner = untag_ptr(contents_arg);
38654 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
38655 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
38656 contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv);
38657 LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv);
38658 int64_t ret_ref = 0;
38659 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38660 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38664 static inline uint64_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) {
38665 LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg);
38666 int64_t ret_ref = 0;
38667 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38668 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38671 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38672 LDKNodeAnnouncement arg_conv;
38673 arg_conv.inner = untag_ptr(arg);
38674 arg_conv.is_owned = ptr_is_owned(arg);
38675 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38676 arg_conv.is_owned = false;
38677 int64_t ret_conv = NodeAnnouncement_clone_ptr(&arg_conv);
38681 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38682 LDKNodeAnnouncement orig_conv;
38683 orig_conv.inner = untag_ptr(orig);
38684 orig_conv.is_owned = ptr_is_owned(orig);
38685 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38686 orig_conv.is_owned = false;
38687 LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv);
38688 int64_t ret_ref = 0;
38689 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38690 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38694 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
38695 LDKNodeAnnouncement a_conv;
38696 a_conv.inner = untag_ptr(a);
38697 a_conv.is_owned = ptr_is_owned(a);
38698 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38699 a_conv.is_owned = false;
38700 LDKNodeAnnouncement b_conv;
38701 b_conv.inner = untag_ptr(b);
38702 b_conv.is_owned = ptr_is_owned(b);
38703 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38704 b_conv.is_owned = false;
38705 jboolean ret_conv = NodeAnnouncement_eq(&a_conv, &b_conv);
38709 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38710 LDKUnsignedChannelAnnouncement this_obj_conv;
38711 this_obj_conv.inner = untag_ptr(this_obj);
38712 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38713 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38714 UnsignedChannelAnnouncement_free(this_obj_conv);
38717 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
38718 LDKUnsignedChannelAnnouncement this_ptr_conv;
38719 this_ptr_conv.inner = untag_ptr(this_ptr);
38720 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38721 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38722 this_ptr_conv.is_owned = false;
38723 LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv);
38724 int64_t ret_ref = 0;
38725 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38726 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38730 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38731 LDKUnsignedChannelAnnouncement this_ptr_conv;
38732 this_ptr_conv.inner = untag_ptr(this_ptr);
38733 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38734 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38735 this_ptr_conv.is_owned = false;
38736 LDKChannelFeatures val_conv;
38737 val_conv.inner = untag_ptr(val);
38738 val_conv.is_owned = ptr_is_owned(val);
38739 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38740 val_conv = ChannelFeatures_clone(&val_conv);
38741 UnsignedChannelAnnouncement_set_features(&this_ptr_conv, val_conv);
38744 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
38745 LDKUnsignedChannelAnnouncement this_ptr_conv;
38746 this_ptr_conv.inner = untag_ptr(this_ptr);
38747 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38748 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38749 this_ptr_conv.is_owned = false;
38750 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
38751 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv));
38755 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
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 LDKThirtyTwoBytes val_ref;
38762 CHECK((*env)->GetArrayLength(env, val) == 32);
38763 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
38764 UnsignedChannelAnnouncement_set_chain_hash(&this_ptr_conv, val_ref);
38767 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
38768 LDKUnsignedChannelAnnouncement this_ptr_conv;
38769 this_ptr_conv.inner = untag_ptr(this_ptr);
38770 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38771 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38772 this_ptr_conv.is_owned = false;
38773 int64_t ret_conv = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv);
38777 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38778 LDKUnsignedChannelAnnouncement this_ptr_conv;
38779 this_ptr_conv.inner = untag_ptr(this_ptr);
38780 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38781 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38782 this_ptr_conv.is_owned = false;
38783 UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val);
38786 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11(JNIEnv *env, jclass clz, int64_t this_ptr) {
38787 LDKUnsignedChannelAnnouncement this_ptr_conv;
38788 this_ptr_conv.inner = untag_ptr(this_ptr);
38789 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38790 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38791 this_ptr_conv.is_owned = false;
38792 LDKNodeId ret_var = UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv);
38793 int64_t ret_ref = 0;
38794 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38795 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38799 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38800 LDKUnsignedChannelAnnouncement this_ptr_conv;
38801 this_ptr_conv.inner = untag_ptr(this_ptr);
38802 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38803 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38804 this_ptr_conv.is_owned = false;
38805 LDKNodeId val_conv;
38806 val_conv.inner = untag_ptr(val);
38807 val_conv.is_owned = ptr_is_owned(val);
38808 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38809 val_conv = NodeId_clone(&val_conv);
38810 UnsignedChannelAnnouncement_set_node_id_1(&this_ptr_conv, val_conv);
38813 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12(JNIEnv *env, jclass clz, int64_t this_ptr) {
38814 LDKUnsignedChannelAnnouncement this_ptr_conv;
38815 this_ptr_conv.inner = untag_ptr(this_ptr);
38816 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38817 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38818 this_ptr_conv.is_owned = false;
38819 LDKNodeId ret_var = UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv);
38820 int64_t ret_ref = 0;
38821 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38822 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38826 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38827 LDKUnsignedChannelAnnouncement this_ptr_conv;
38828 this_ptr_conv.inner = untag_ptr(this_ptr);
38829 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38830 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38831 this_ptr_conv.is_owned = false;
38832 LDKNodeId val_conv;
38833 val_conv.inner = untag_ptr(val);
38834 val_conv.is_owned = ptr_is_owned(val);
38835 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38836 val_conv = NodeId_clone(&val_conv);
38837 UnsignedChannelAnnouncement_set_node_id_2(&this_ptr_conv, val_conv);
38840 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11(JNIEnv *env, jclass clz, int64_t this_ptr) {
38841 LDKUnsignedChannelAnnouncement this_ptr_conv;
38842 this_ptr_conv.inner = untag_ptr(this_ptr);
38843 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38845 this_ptr_conv.is_owned = false;
38846 LDKNodeId ret_var = UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv);
38847 int64_t ret_ref = 0;
38848 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38849 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38853 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38854 LDKUnsignedChannelAnnouncement this_ptr_conv;
38855 this_ptr_conv.inner = untag_ptr(this_ptr);
38856 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38857 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38858 this_ptr_conv.is_owned = false;
38859 LDKNodeId val_conv;
38860 val_conv.inner = untag_ptr(val);
38861 val_conv.is_owned = ptr_is_owned(val);
38862 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38863 val_conv = NodeId_clone(&val_conv);
38864 UnsignedChannelAnnouncement_set_bitcoin_key_1(&this_ptr_conv, val_conv);
38867 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12(JNIEnv *env, jclass clz, int64_t this_ptr) {
38868 LDKUnsignedChannelAnnouncement this_ptr_conv;
38869 this_ptr_conv.inner = untag_ptr(this_ptr);
38870 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38871 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38872 this_ptr_conv.is_owned = false;
38873 LDKNodeId ret_var = UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv);
38874 int64_t ret_ref = 0;
38875 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38876 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38880 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
38881 LDKUnsignedChannelAnnouncement this_ptr_conv;
38882 this_ptr_conv.inner = untag_ptr(this_ptr);
38883 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38884 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38885 this_ptr_conv.is_owned = false;
38886 LDKNodeId val_conv;
38887 val_conv.inner = untag_ptr(val);
38888 val_conv.is_owned = ptr_is_owned(val);
38889 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38890 val_conv = NodeId_clone(&val_conv);
38891 UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_conv);
38894 static inline uint64_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) {
38895 LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg);
38896 int64_t ret_ref = 0;
38897 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38898 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38901 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
38902 LDKUnsignedChannelAnnouncement arg_conv;
38903 arg_conv.inner = untag_ptr(arg);
38904 arg_conv.is_owned = ptr_is_owned(arg);
38905 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38906 arg_conv.is_owned = false;
38907 int64_t ret_conv = UnsignedChannelAnnouncement_clone_ptr(&arg_conv);
38911 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
38912 LDKUnsignedChannelAnnouncement orig_conv;
38913 orig_conv.inner = untag_ptr(orig);
38914 orig_conv.is_owned = ptr_is_owned(orig);
38915 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38916 orig_conv.is_owned = false;
38917 LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv);
38918 int64_t ret_ref = 0;
38919 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38920 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38924 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
38925 LDKUnsignedChannelAnnouncement a_conv;
38926 a_conv.inner = untag_ptr(a);
38927 a_conv.is_owned = ptr_is_owned(a);
38928 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38929 a_conv.is_owned = false;
38930 LDKUnsignedChannelAnnouncement b_conv;
38931 b_conv.inner = untag_ptr(b);
38932 b_conv.is_owned = ptr_is_owned(b);
38933 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38934 b_conv.is_owned = false;
38935 jboolean ret_conv = UnsignedChannelAnnouncement_eq(&a_conv, &b_conv);
38939 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
38940 LDKChannelAnnouncement this_obj_conv;
38941 this_obj_conv.inner = untag_ptr(this_obj);
38942 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38943 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38944 ChannelAnnouncement_free(this_obj_conv);
38947 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr) {
38948 LDKChannelAnnouncement this_ptr_conv;
38949 this_ptr_conv.inner = untag_ptr(this_ptr);
38950 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38951 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38952 this_ptr_conv.is_owned = false;
38953 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
38954 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form);
38958 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38959 LDKChannelAnnouncement this_ptr_conv;
38960 this_ptr_conv.inner = untag_ptr(this_ptr);
38961 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38962 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38963 this_ptr_conv.is_owned = false;
38964 LDKSignature val_ref;
38965 CHECK((*env)->GetArrayLength(env, val) == 64);
38966 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
38967 ChannelAnnouncement_set_node_signature_1(&this_ptr_conv, val_ref);
38970 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr) {
38971 LDKChannelAnnouncement this_ptr_conv;
38972 this_ptr_conv.inner = untag_ptr(this_ptr);
38973 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38974 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38975 this_ptr_conv.is_owned = false;
38976 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
38977 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form);
38981 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
38982 LDKChannelAnnouncement this_ptr_conv;
38983 this_ptr_conv.inner = untag_ptr(this_ptr);
38984 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38985 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38986 this_ptr_conv.is_owned = false;
38987 LDKSignature val_ref;
38988 CHECK((*env)->GetArrayLength(env, val) == 64);
38989 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
38990 ChannelAnnouncement_set_node_signature_2(&this_ptr_conv, val_ref);
38993 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr) {
38994 LDKChannelAnnouncement this_ptr_conv;
38995 this_ptr_conv.inner = untag_ptr(this_ptr);
38996 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38997 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38998 this_ptr_conv.is_owned = false;
38999 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
39000 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form);
39004 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
39005 LDKChannelAnnouncement this_ptr_conv;
39006 this_ptr_conv.inner = untag_ptr(this_ptr);
39007 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39008 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39009 this_ptr_conv.is_owned = false;
39010 LDKSignature val_ref;
39011 CHECK((*env)->GetArrayLength(env, val) == 64);
39012 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
39013 ChannelAnnouncement_set_bitcoin_signature_1(&this_ptr_conv, val_ref);
39016 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr) {
39017 LDKChannelAnnouncement this_ptr_conv;
39018 this_ptr_conv.inner = untag_ptr(this_ptr);
39019 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39020 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39021 this_ptr_conv.is_owned = false;
39022 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
39023 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form);
39027 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
39028 LDKChannelAnnouncement this_ptr_conv;
39029 this_ptr_conv.inner = untag_ptr(this_ptr);
39030 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39031 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39032 this_ptr_conv.is_owned = false;
39033 LDKSignature val_ref;
39034 CHECK((*env)->GetArrayLength(env, val) == 64);
39035 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
39036 ChannelAnnouncement_set_bitcoin_signature_2(&this_ptr_conv, val_ref);
39039 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) {
39040 LDKChannelAnnouncement this_ptr_conv;
39041 this_ptr_conv.inner = untag_ptr(this_ptr);
39042 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39043 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39044 this_ptr_conv.is_owned = false;
39045 LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv);
39046 int64_t ret_ref = 0;
39047 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39048 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39052 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
39053 LDKChannelAnnouncement this_ptr_conv;
39054 this_ptr_conv.inner = untag_ptr(this_ptr);
39055 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39056 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39057 this_ptr_conv.is_owned = false;
39058 LDKUnsignedChannelAnnouncement val_conv;
39059 val_conv.inner = untag_ptr(val);
39060 val_conv.is_owned = ptr_is_owned(val);
39061 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39062 val_conv = UnsignedChannelAnnouncement_clone(&val_conv);
39063 ChannelAnnouncement_set_contents(&this_ptr_conv, val_conv);
39066 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) {
39067 LDKSignature node_signature_1_arg_ref;
39068 CHECK((*env)->GetArrayLength(env, node_signature_1_arg) == 64);
39069 (*env)->GetByteArrayRegion(env, node_signature_1_arg, 0, 64, node_signature_1_arg_ref.compact_form);
39070 LDKSignature node_signature_2_arg_ref;
39071 CHECK((*env)->GetArrayLength(env, node_signature_2_arg) == 64);
39072 (*env)->GetByteArrayRegion(env, node_signature_2_arg, 0, 64, node_signature_2_arg_ref.compact_form);
39073 LDKSignature bitcoin_signature_1_arg_ref;
39074 CHECK((*env)->GetArrayLength(env, bitcoin_signature_1_arg) == 64);
39075 (*env)->GetByteArrayRegion(env, bitcoin_signature_1_arg, 0, 64, bitcoin_signature_1_arg_ref.compact_form);
39076 LDKSignature bitcoin_signature_2_arg_ref;
39077 CHECK((*env)->GetArrayLength(env, bitcoin_signature_2_arg) == 64);
39078 (*env)->GetByteArrayRegion(env, bitcoin_signature_2_arg, 0, 64, bitcoin_signature_2_arg_ref.compact_form);
39079 LDKUnsignedChannelAnnouncement contents_arg_conv;
39080 contents_arg_conv.inner = untag_ptr(contents_arg);
39081 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
39082 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
39083 contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv);
39084 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);
39085 int64_t ret_ref = 0;
39086 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39087 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39091 static inline uint64_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) {
39092 LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg);
39093 int64_t ret_ref = 0;
39094 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39095 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39098 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
39099 LDKChannelAnnouncement arg_conv;
39100 arg_conv.inner = untag_ptr(arg);
39101 arg_conv.is_owned = ptr_is_owned(arg);
39102 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39103 arg_conv.is_owned = false;
39104 int64_t ret_conv = ChannelAnnouncement_clone_ptr(&arg_conv);
39108 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone(JNIEnv *env, jclass clz, int64_t orig) {
39109 LDKChannelAnnouncement orig_conv;
39110 orig_conv.inner = untag_ptr(orig);
39111 orig_conv.is_owned = ptr_is_owned(orig);
39112 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39113 orig_conv.is_owned = false;
39114 LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv);
39115 int64_t ret_ref = 0;
39116 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39117 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39121 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
39122 LDKChannelAnnouncement a_conv;
39123 a_conv.inner = untag_ptr(a);
39124 a_conv.is_owned = ptr_is_owned(a);
39125 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39126 a_conv.is_owned = false;
39127 LDKChannelAnnouncement b_conv;
39128 b_conv.inner = untag_ptr(b);
39129 b_conv.is_owned = ptr_is_owned(b);
39130 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39131 b_conv.is_owned = false;
39132 jboolean ret_conv = ChannelAnnouncement_eq(&a_conv, &b_conv);
39136 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39137 LDKUnsignedChannelUpdate this_obj_conv;
39138 this_obj_conv.inner = untag_ptr(this_obj);
39139 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39140 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39141 UnsignedChannelUpdate_free(this_obj_conv);
39144 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
39145 LDKUnsignedChannelUpdate this_ptr_conv;
39146 this_ptr_conv.inner = untag_ptr(this_ptr);
39147 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39148 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39149 this_ptr_conv.is_owned = false;
39150 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
39151 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv));
39155 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
39156 LDKUnsignedChannelUpdate this_ptr_conv;
39157 this_ptr_conv.inner = untag_ptr(this_ptr);
39158 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39159 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39160 this_ptr_conv.is_owned = false;
39161 LDKThirtyTwoBytes val_ref;
39162 CHECK((*env)->GetArrayLength(env, val) == 32);
39163 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
39164 UnsignedChannelUpdate_set_chain_hash(&this_ptr_conv, val_ref);
39167 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
39168 LDKUnsignedChannelUpdate this_ptr_conv;
39169 this_ptr_conv.inner = untag_ptr(this_ptr);
39170 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39171 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39172 this_ptr_conv.is_owned = false;
39173 int64_t ret_conv = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv);
39177 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
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 UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val);
39186 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) {
39187 LDKUnsignedChannelUpdate this_ptr_conv;
39188 this_ptr_conv.inner = untag_ptr(this_ptr);
39189 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39190 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39191 this_ptr_conv.is_owned = false;
39192 int32_t ret_conv = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv);
39196 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
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 UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val);
39205 JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv *env, jclass clz, int64_t this_ptr) {
39206 LDKUnsignedChannelUpdate this_ptr_conv;
39207 this_ptr_conv.inner = untag_ptr(this_ptr);
39208 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39209 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39210 this_ptr_conv.is_owned = false;
39211 int8_t ret_conv = UnsignedChannelUpdate_get_flags(&this_ptr_conv);
39215 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) {
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 UnsignedChannelUpdate_set_flags(&this_ptr_conv, val);
39224 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
39225 LDKUnsignedChannelUpdate this_ptr_conv;
39226 this_ptr_conv.inner = untag_ptr(this_ptr);
39227 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39228 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39229 this_ptr_conv.is_owned = false;
39230 int16_t ret_conv = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv);
39234 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
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 UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val);
39243 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
39244 LDKUnsignedChannelUpdate this_ptr_conv;
39245 this_ptr_conv.inner = untag_ptr(this_ptr);
39246 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39247 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39248 this_ptr_conv.is_owned = false;
39249 int64_t ret_conv = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv);
39253 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
39254 LDKUnsignedChannelUpdate this_ptr_conv;
39255 this_ptr_conv.inner = untag_ptr(this_ptr);
39256 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39257 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39258 this_ptr_conv.is_owned = false;
39259 UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val);
39262 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
39263 LDKUnsignedChannelUpdate this_ptr_conv;
39264 this_ptr_conv.inner = untag_ptr(this_ptr);
39265 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39266 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39267 this_ptr_conv.is_owned = false;
39268 int64_t ret_conv = UnsignedChannelUpdate_get_htlc_maximum_msat(&this_ptr_conv);
39272 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
39273 LDKUnsignedChannelUpdate this_ptr_conv;
39274 this_ptr_conv.inner = untag_ptr(this_ptr);
39275 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39276 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39277 this_ptr_conv.is_owned = false;
39278 UnsignedChannelUpdate_set_htlc_maximum_msat(&this_ptr_conv, val);
39281 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
39282 LDKUnsignedChannelUpdate this_ptr_conv;
39283 this_ptr_conv.inner = untag_ptr(this_ptr);
39284 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39285 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39286 this_ptr_conv.is_owned = false;
39287 int32_t ret_conv = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv);
39291 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
39292 LDKUnsignedChannelUpdate this_ptr_conv;
39293 this_ptr_conv.inner = untag_ptr(this_ptr);
39294 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39296 this_ptr_conv.is_owned = false;
39297 UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val);
39300 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
39301 LDKUnsignedChannelUpdate this_ptr_conv;
39302 this_ptr_conv.inner = untag_ptr(this_ptr);
39303 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39304 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39305 this_ptr_conv.is_owned = false;
39306 int32_t ret_conv = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv);
39310 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
39311 LDKUnsignedChannelUpdate this_ptr_conv;
39312 this_ptr_conv.inner = untag_ptr(this_ptr);
39313 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39314 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39315 this_ptr_conv.is_owned = false;
39316 UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val);
39319 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1excess_1data(JNIEnv *env, jclass clz, int64_t this_ptr) {
39320 LDKUnsignedChannelUpdate this_ptr_conv;
39321 this_ptr_conv.inner = untag_ptr(this_ptr);
39322 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39323 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39324 this_ptr_conv.is_owned = false;
39325 LDKCVec_u8Z ret_var = UnsignedChannelUpdate_get_excess_data(&this_ptr_conv);
39326 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
39327 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
39328 CVec_u8Z_free(ret_var);
39332 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1excess_1data(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
39333 LDKUnsignedChannelUpdate this_ptr_conv;
39334 this_ptr_conv.inner = untag_ptr(this_ptr);
39335 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39336 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39337 this_ptr_conv.is_owned = false;
39338 LDKCVec_u8Z val_ref;
39339 val_ref.datalen = (*env)->GetArrayLength(env, val);
39340 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
39341 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
39342 UnsignedChannelUpdate_set_excess_data(&this_ptr_conv, val_ref);
39345 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) {
39346 LDKThirtyTwoBytes chain_hash_arg_ref;
39347 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
39348 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
39349 LDKCVec_u8Z excess_data_arg_ref;
39350 excess_data_arg_ref.datalen = (*env)->GetArrayLength(env, excess_data_arg);
39351 excess_data_arg_ref.data = MALLOC(excess_data_arg_ref.datalen, "LDKCVec_u8Z Bytes");
39352 (*env)->GetByteArrayRegion(env, excess_data_arg, 0, excess_data_arg_ref.datalen, excess_data_arg_ref.data);
39353 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);
39354 int64_t ret_ref = 0;
39355 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39356 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39360 static inline uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) {
39361 LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg);
39362 int64_t ret_ref = 0;
39363 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39364 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39367 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
39368 LDKUnsignedChannelUpdate arg_conv;
39369 arg_conv.inner = untag_ptr(arg);
39370 arg_conv.is_owned = ptr_is_owned(arg);
39371 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39372 arg_conv.is_owned = false;
39373 int64_t ret_conv = UnsignedChannelUpdate_clone_ptr(&arg_conv);
39377 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
39378 LDKUnsignedChannelUpdate orig_conv;
39379 orig_conv.inner = untag_ptr(orig);
39380 orig_conv.is_owned = ptr_is_owned(orig);
39381 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39382 orig_conv.is_owned = false;
39383 LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv);
39384 int64_t ret_ref = 0;
39385 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39386 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39390 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
39391 LDKUnsignedChannelUpdate a_conv;
39392 a_conv.inner = untag_ptr(a);
39393 a_conv.is_owned = ptr_is_owned(a);
39394 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39395 a_conv.is_owned = false;
39396 LDKUnsignedChannelUpdate b_conv;
39397 b_conv.inner = untag_ptr(b);
39398 b_conv.is_owned = ptr_is_owned(b);
39399 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39400 b_conv.is_owned = false;
39401 jboolean ret_conv = UnsignedChannelUpdate_eq(&a_conv, &b_conv);
39405 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39406 LDKChannelUpdate this_obj_conv;
39407 this_obj_conv.inner = untag_ptr(this_obj);
39408 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39409 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39410 ChannelUpdate_free(this_obj_conv);
39413 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv *env, jclass clz, int64_t this_ptr) {
39414 LDKChannelUpdate this_ptr_conv;
39415 this_ptr_conv.inner = untag_ptr(this_ptr);
39416 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39417 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39418 this_ptr_conv.is_owned = false;
39419 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
39420 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, ChannelUpdate_get_signature(&this_ptr_conv).compact_form);
39424 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
39425 LDKChannelUpdate this_ptr_conv;
39426 this_ptr_conv.inner = untag_ptr(this_ptr);
39427 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39428 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39429 this_ptr_conv.is_owned = false;
39430 LDKSignature val_ref;
39431 CHECK((*env)->GetArrayLength(env, val) == 64);
39432 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
39433 ChannelUpdate_set_signature(&this_ptr_conv, val_ref);
39436 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(JNIEnv *env, jclass clz, int64_t this_ptr) {
39437 LDKChannelUpdate this_ptr_conv;
39438 this_ptr_conv.inner = untag_ptr(this_ptr);
39439 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39440 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39441 this_ptr_conv.is_owned = false;
39442 LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv);
39443 int64_t ret_ref = 0;
39444 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39445 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39449 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
39450 LDKChannelUpdate this_ptr_conv;
39451 this_ptr_conv.inner = untag_ptr(this_ptr);
39452 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39453 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39454 this_ptr_conv.is_owned = false;
39455 LDKUnsignedChannelUpdate val_conv;
39456 val_conv.inner = untag_ptr(val);
39457 val_conv.is_owned = ptr_is_owned(val);
39458 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39459 val_conv = UnsignedChannelUpdate_clone(&val_conv);
39460 ChannelUpdate_set_contents(&this_ptr_conv, val_conv);
39463 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv *env, jclass clz, int8_tArray signature_arg, int64_t contents_arg) {
39464 LDKSignature signature_arg_ref;
39465 CHECK((*env)->GetArrayLength(env, signature_arg) == 64);
39466 (*env)->GetByteArrayRegion(env, signature_arg, 0, 64, signature_arg_ref.compact_form);
39467 LDKUnsignedChannelUpdate contents_arg_conv;
39468 contents_arg_conv.inner = untag_ptr(contents_arg);
39469 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
39470 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
39471 contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv);
39472 LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv);
39473 int64_t ret_ref = 0;
39474 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39475 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39479 static inline uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) {
39480 LDKChannelUpdate ret_var = ChannelUpdate_clone(arg);
39481 int64_t ret_ref = 0;
39482 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39483 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39486 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
39487 LDKChannelUpdate arg_conv;
39488 arg_conv.inner = untag_ptr(arg);
39489 arg_conv.is_owned = ptr_is_owned(arg);
39490 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39491 arg_conv.is_owned = false;
39492 int64_t ret_conv = ChannelUpdate_clone_ptr(&arg_conv);
39496 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
39497 LDKChannelUpdate orig_conv;
39498 orig_conv.inner = untag_ptr(orig);
39499 orig_conv.is_owned = ptr_is_owned(orig);
39500 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39501 orig_conv.is_owned = false;
39502 LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv);
39503 int64_t ret_ref = 0;
39504 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39505 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39509 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
39510 LDKChannelUpdate a_conv;
39511 a_conv.inner = untag_ptr(a);
39512 a_conv.is_owned = ptr_is_owned(a);
39513 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39514 a_conv.is_owned = false;
39515 LDKChannelUpdate b_conv;
39516 b_conv.inner = untag_ptr(b);
39517 b_conv.is_owned = ptr_is_owned(b);
39518 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39519 b_conv.is_owned = false;
39520 jboolean ret_conv = ChannelUpdate_eq(&a_conv, &b_conv);
39524 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39525 LDKQueryChannelRange this_obj_conv;
39526 this_obj_conv.inner = untag_ptr(this_obj);
39527 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39528 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39529 QueryChannelRange_free(this_obj_conv);
39532 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
39533 LDKQueryChannelRange this_ptr_conv;
39534 this_ptr_conv.inner = untag_ptr(this_ptr);
39535 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39536 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39537 this_ptr_conv.is_owned = false;
39538 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
39539 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(&this_ptr_conv));
39543 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
39544 LDKQueryChannelRange this_ptr_conv;
39545 this_ptr_conv.inner = untag_ptr(this_ptr);
39546 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39547 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39548 this_ptr_conv.is_owned = false;
39549 LDKThirtyTwoBytes val_ref;
39550 CHECK((*env)->GetArrayLength(env, val) == 32);
39551 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
39552 QueryChannelRange_set_chain_hash(&this_ptr_conv, val_ref);
39555 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr) {
39556 LDKQueryChannelRange this_ptr_conv;
39557 this_ptr_conv.inner = untag_ptr(this_ptr);
39558 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39559 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39560 this_ptr_conv.is_owned = false;
39561 int32_t ret_conv = QueryChannelRange_get_first_blocknum(&this_ptr_conv);
39565 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
39566 LDKQueryChannelRange this_ptr_conv;
39567 this_ptr_conv.inner = untag_ptr(this_ptr);
39568 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39569 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39570 this_ptr_conv.is_owned = false;
39571 QueryChannelRange_set_first_blocknum(&this_ptr_conv, val);
39574 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr) {
39575 LDKQueryChannelRange this_ptr_conv;
39576 this_ptr_conv.inner = untag_ptr(this_ptr);
39577 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39578 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39579 this_ptr_conv.is_owned = false;
39580 int32_t ret_conv = QueryChannelRange_get_number_of_blocks(&this_ptr_conv);
39584 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
39585 LDKQueryChannelRange this_ptr_conv;
39586 this_ptr_conv.inner = untag_ptr(this_ptr);
39587 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39588 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39589 this_ptr_conv.is_owned = false;
39590 QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val);
39593 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) {
39594 LDKThirtyTwoBytes chain_hash_arg_ref;
39595 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
39596 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
39597 LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg);
39598 int64_t ret_ref = 0;
39599 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39600 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39604 static inline uint64_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) {
39605 LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg);
39606 int64_t ret_ref = 0;
39607 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39608 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39611 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
39612 LDKQueryChannelRange arg_conv;
39613 arg_conv.inner = untag_ptr(arg);
39614 arg_conv.is_owned = ptr_is_owned(arg);
39615 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39616 arg_conv.is_owned = false;
39617 int64_t ret_conv = QueryChannelRange_clone_ptr(&arg_conv);
39621 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) {
39622 LDKQueryChannelRange orig_conv;
39623 orig_conv.inner = untag_ptr(orig);
39624 orig_conv.is_owned = ptr_is_owned(orig);
39625 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39626 orig_conv.is_owned = false;
39627 LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv);
39628 int64_t ret_ref = 0;
39629 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39630 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39634 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
39635 LDKQueryChannelRange a_conv;
39636 a_conv.inner = untag_ptr(a);
39637 a_conv.is_owned = ptr_is_owned(a);
39638 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39639 a_conv.is_owned = false;
39640 LDKQueryChannelRange b_conv;
39641 b_conv.inner = untag_ptr(b);
39642 b_conv.is_owned = ptr_is_owned(b);
39643 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39644 b_conv.is_owned = false;
39645 jboolean ret_conv = QueryChannelRange_eq(&a_conv, &b_conv);
39649 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39650 LDKReplyChannelRange this_obj_conv;
39651 this_obj_conv.inner = untag_ptr(this_obj);
39652 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39653 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39654 ReplyChannelRange_free(this_obj_conv);
39657 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
39658 LDKReplyChannelRange this_ptr_conv;
39659 this_ptr_conv.inner = untag_ptr(this_ptr);
39660 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39661 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39662 this_ptr_conv.is_owned = false;
39663 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
39664 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(&this_ptr_conv));
39668 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
39669 LDKReplyChannelRange this_ptr_conv;
39670 this_ptr_conv.inner = untag_ptr(this_ptr);
39671 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39672 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39673 this_ptr_conv.is_owned = false;
39674 LDKThirtyTwoBytes val_ref;
39675 CHECK((*env)->GetArrayLength(env, val) == 32);
39676 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
39677 ReplyChannelRange_set_chain_hash(&this_ptr_conv, val_ref);
39680 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr) {
39681 LDKReplyChannelRange this_ptr_conv;
39682 this_ptr_conv.inner = untag_ptr(this_ptr);
39683 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39684 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39685 this_ptr_conv.is_owned = false;
39686 int32_t ret_conv = ReplyChannelRange_get_first_blocknum(&this_ptr_conv);
39690 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_1blocknum(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
39691 LDKReplyChannelRange this_ptr_conv;
39692 this_ptr_conv.inner = untag_ptr(this_ptr);
39693 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39694 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39695 this_ptr_conv.is_owned = false;
39696 ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val);
39699 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr) {
39700 LDKReplyChannelRange this_ptr_conv;
39701 this_ptr_conv.inner = untag_ptr(this_ptr);
39702 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39703 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39704 this_ptr_conv.is_owned = false;
39705 int32_t ret_conv = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv);
39709 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number_1of_1blocks(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
39710 LDKReplyChannelRange this_ptr_conv;
39711 this_ptr_conv.inner = untag_ptr(this_ptr);
39712 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39713 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39714 this_ptr_conv.is_owned = false;
39715 ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val);
39718 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_ptr) {
39719 LDKReplyChannelRange this_ptr_conv;
39720 this_ptr_conv.inner = untag_ptr(this_ptr);
39721 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39722 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39723 this_ptr_conv.is_owned = false;
39724 jboolean ret_conv = ReplyChannelRange_get_sync_complete(&this_ptr_conv);
39728 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
39729 LDKReplyChannelRange this_ptr_conv;
39730 this_ptr_conv.inner = untag_ptr(this_ptr);
39731 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39732 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39733 this_ptr_conv.is_owned = false;
39734 ReplyChannelRange_set_sync_complete(&this_ptr_conv, val);
39737 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr) {
39738 LDKReplyChannelRange this_ptr_conv;
39739 this_ptr_conv.inner = untag_ptr(this_ptr);
39740 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39741 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39742 this_ptr_conv.is_owned = false;
39743 LDKCVec_u64Z ret_var = ReplyChannelRange_get_short_channel_ids(&this_ptr_conv);
39744 int64_tArray ret_arr = NULL;
39745 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
39746 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
39747 for (size_t g = 0; g < ret_var.datalen; g++) {
39748 int64_t ret_conv_6_conv = ret_var.data[g];
39749 ret_arr_ptr[g] = ret_conv_6_conv;
39751 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
39752 FREE(ret_var.data);
39756 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
39757 LDKReplyChannelRange this_ptr_conv;
39758 this_ptr_conv.inner = untag_ptr(this_ptr);
39759 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39760 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39761 this_ptr_conv.is_owned = false;
39762 LDKCVec_u64Z val_constr;
39763 val_constr.datalen = (*env)->GetArrayLength(env, val);
39764 if (val_constr.datalen > 0)
39765 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
39767 val_constr.data = NULL;
39768 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
39769 for (size_t g = 0; g < val_constr.datalen; g++) {
39770 int64_t val_conv_6 = val_vals[g];
39771 val_constr.data[g] = val_conv_6;
39773 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
39774 ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr);
39777 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) {
39778 LDKThirtyTwoBytes chain_hash_arg_ref;
39779 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
39780 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
39781 LDKCVec_u64Z short_channel_ids_arg_constr;
39782 short_channel_ids_arg_constr.datalen = (*env)->GetArrayLength(env, short_channel_ids_arg);
39783 if (short_channel_ids_arg_constr.datalen > 0)
39784 short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
39786 short_channel_ids_arg_constr.data = NULL;
39787 int64_t* short_channel_ids_arg_vals = (*env)->GetLongArrayElements (env, short_channel_ids_arg, NULL);
39788 for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) {
39789 int64_t short_channel_ids_arg_conv_6 = short_channel_ids_arg_vals[g];
39790 short_channel_ids_arg_constr.data[g] = short_channel_ids_arg_conv_6;
39792 (*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0);
39793 LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr);
39794 int64_t ret_ref = 0;
39795 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39796 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39800 static inline uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) {
39801 LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg);
39802 int64_t ret_ref = 0;
39803 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39804 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39807 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
39808 LDKReplyChannelRange arg_conv;
39809 arg_conv.inner = untag_ptr(arg);
39810 arg_conv.is_owned = ptr_is_owned(arg);
39811 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39812 arg_conv.is_owned = false;
39813 int64_t ret_conv = ReplyChannelRange_clone_ptr(&arg_conv);
39817 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone(JNIEnv *env, jclass clz, int64_t orig) {
39818 LDKReplyChannelRange orig_conv;
39819 orig_conv.inner = untag_ptr(orig);
39820 orig_conv.is_owned = ptr_is_owned(orig);
39821 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39822 orig_conv.is_owned = false;
39823 LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv);
39824 int64_t ret_ref = 0;
39825 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39826 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39830 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
39831 LDKReplyChannelRange a_conv;
39832 a_conv.inner = untag_ptr(a);
39833 a_conv.is_owned = ptr_is_owned(a);
39834 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39835 a_conv.is_owned = false;
39836 LDKReplyChannelRange b_conv;
39837 b_conv.inner = untag_ptr(b);
39838 b_conv.is_owned = ptr_is_owned(b);
39839 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39840 b_conv.is_owned = false;
39841 jboolean ret_conv = ReplyChannelRange_eq(&a_conv, &b_conv);
39845 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39846 LDKQueryShortChannelIds this_obj_conv;
39847 this_obj_conv.inner = untag_ptr(this_obj);
39848 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39849 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39850 QueryShortChannelIds_free(this_obj_conv);
39853 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
39854 LDKQueryShortChannelIds this_ptr_conv;
39855 this_ptr_conv.inner = untag_ptr(this_ptr);
39856 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39857 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39858 this_ptr_conv.is_owned = false;
39859 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
39860 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv));
39864 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
39865 LDKQueryShortChannelIds this_ptr_conv;
39866 this_ptr_conv.inner = untag_ptr(this_ptr);
39867 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39868 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39869 this_ptr_conv.is_owned = false;
39870 LDKThirtyTwoBytes val_ref;
39871 CHECK((*env)->GetArrayLength(env, val) == 32);
39872 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
39873 QueryShortChannelIds_set_chain_hash(&this_ptr_conv, val_ref);
39876 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr) {
39877 LDKQueryShortChannelIds this_ptr_conv;
39878 this_ptr_conv.inner = untag_ptr(this_ptr);
39879 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39880 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39881 this_ptr_conv.is_owned = false;
39882 LDKCVec_u64Z ret_var = QueryShortChannelIds_get_short_channel_ids(&this_ptr_conv);
39883 int64_tArray ret_arr = NULL;
39884 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
39885 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
39886 for (size_t g = 0; g < ret_var.datalen; g++) {
39887 int64_t ret_conv_6_conv = ret_var.data[g];
39888 ret_arr_ptr[g] = ret_conv_6_conv;
39890 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
39891 FREE(ret_var.data);
39895 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1short_1channel_1ids(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
39896 LDKQueryShortChannelIds this_ptr_conv;
39897 this_ptr_conv.inner = untag_ptr(this_ptr);
39898 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39899 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39900 this_ptr_conv.is_owned = false;
39901 LDKCVec_u64Z val_constr;
39902 val_constr.datalen = (*env)->GetArrayLength(env, val);
39903 if (val_constr.datalen > 0)
39904 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
39906 val_constr.data = NULL;
39907 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
39908 for (size_t g = 0; g < val_constr.datalen; g++) {
39909 int64_t val_conv_6 = val_vals[g];
39910 val_constr.data[g] = val_conv_6;
39912 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
39913 QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr);
39916 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) {
39917 LDKThirtyTwoBytes chain_hash_arg_ref;
39918 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
39919 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
39920 LDKCVec_u64Z short_channel_ids_arg_constr;
39921 short_channel_ids_arg_constr.datalen = (*env)->GetArrayLength(env, short_channel_ids_arg);
39922 if (short_channel_ids_arg_constr.datalen > 0)
39923 short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
39925 short_channel_ids_arg_constr.data = NULL;
39926 int64_t* short_channel_ids_arg_vals = (*env)->GetLongArrayElements (env, short_channel_ids_arg, NULL);
39927 for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) {
39928 int64_t short_channel_ids_arg_conv_6 = short_channel_ids_arg_vals[g];
39929 short_channel_ids_arg_constr.data[g] = short_channel_ids_arg_conv_6;
39931 (*env)->ReleaseLongArrayElements(env, short_channel_ids_arg, short_channel_ids_arg_vals, 0);
39932 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr);
39933 int64_t ret_ref = 0;
39934 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39935 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39939 static inline uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) {
39940 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg);
39941 int64_t ret_ref = 0;
39942 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39943 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39946 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
39947 LDKQueryShortChannelIds arg_conv;
39948 arg_conv.inner = untag_ptr(arg);
39949 arg_conv.is_owned = ptr_is_owned(arg);
39950 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39951 arg_conv.is_owned = false;
39952 int64_t ret_conv = QueryShortChannelIds_clone_ptr(&arg_conv);
39956 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone(JNIEnv *env, jclass clz, int64_t orig) {
39957 LDKQueryShortChannelIds orig_conv;
39958 orig_conv.inner = untag_ptr(orig);
39959 orig_conv.is_owned = ptr_is_owned(orig);
39960 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39961 orig_conv.is_owned = false;
39962 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv);
39963 int64_t ret_ref = 0;
39964 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39965 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39969 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
39970 LDKQueryShortChannelIds a_conv;
39971 a_conv.inner = untag_ptr(a);
39972 a_conv.is_owned = ptr_is_owned(a);
39973 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39974 a_conv.is_owned = false;
39975 LDKQueryShortChannelIds b_conv;
39976 b_conv.inner = untag_ptr(b);
39977 b_conv.is_owned = ptr_is_owned(b);
39978 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39979 b_conv.is_owned = false;
39980 jboolean ret_conv = QueryShortChannelIds_eq(&a_conv, &b_conv);
39984 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
39985 LDKReplyShortChannelIdsEnd this_obj_conv;
39986 this_obj_conv.inner = untag_ptr(this_obj);
39987 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39988 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39989 ReplyShortChannelIdsEnd_free(this_obj_conv);
39992 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
39993 LDKReplyShortChannelIdsEnd this_ptr_conv;
39994 this_ptr_conv.inner = untag_ptr(this_ptr);
39995 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39996 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39997 this_ptr_conv.is_owned = false;
39998 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
39999 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv));
40003 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
40004 LDKReplyShortChannelIdsEnd this_ptr_conv;
40005 this_ptr_conv.inner = untag_ptr(this_ptr);
40006 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40007 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40008 this_ptr_conv.is_owned = false;
40009 LDKThirtyTwoBytes val_ref;
40010 CHECK((*env)->GetArrayLength(env, val) == 32);
40011 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
40012 ReplyShortChannelIdsEnd_set_chain_hash(&this_ptr_conv, val_ref);
40015 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1full_1information(JNIEnv *env, jclass clz, int64_t this_ptr) {
40016 LDKReplyShortChannelIdsEnd this_ptr_conv;
40017 this_ptr_conv.inner = untag_ptr(this_ptr);
40018 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40019 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40020 this_ptr_conv.is_owned = false;
40021 jboolean ret_conv = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv);
40025 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1full_1information(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
40026 LDKReplyShortChannelIdsEnd this_ptr_conv;
40027 this_ptr_conv.inner = untag_ptr(this_ptr);
40028 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40029 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40030 this_ptr_conv.is_owned = false;
40031 ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val);
40034 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1new(JNIEnv *env, jclass clz, int8_tArray chain_hash_arg, jboolean full_information_arg) {
40035 LDKThirtyTwoBytes chain_hash_arg_ref;
40036 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
40037 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
40038 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_arg);
40039 int64_t ret_ref = 0;
40040 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40041 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40045 static inline uint64_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) {
40046 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg);
40047 int64_t ret_ref = 0;
40048 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40049 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40052 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
40053 LDKReplyShortChannelIdsEnd arg_conv;
40054 arg_conv.inner = untag_ptr(arg);
40055 arg_conv.is_owned = ptr_is_owned(arg);
40056 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40057 arg_conv.is_owned = false;
40058 int64_t ret_conv = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv);
40062 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone(JNIEnv *env, jclass clz, int64_t orig) {
40063 LDKReplyShortChannelIdsEnd orig_conv;
40064 orig_conv.inner = untag_ptr(orig);
40065 orig_conv.is_owned = ptr_is_owned(orig);
40066 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40067 orig_conv.is_owned = false;
40068 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv);
40069 int64_t ret_ref = 0;
40070 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40071 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40075 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
40076 LDKReplyShortChannelIdsEnd a_conv;
40077 a_conv.inner = untag_ptr(a);
40078 a_conv.is_owned = ptr_is_owned(a);
40079 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
40080 a_conv.is_owned = false;
40081 LDKReplyShortChannelIdsEnd b_conv;
40082 b_conv.inner = untag_ptr(b);
40083 b_conv.is_owned = ptr_is_owned(b);
40084 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40085 b_conv.is_owned = false;
40086 jboolean ret_conv = ReplyShortChannelIdsEnd_eq(&a_conv, &b_conv);
40090 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
40091 LDKGossipTimestampFilter this_obj_conv;
40092 this_obj_conv.inner = untag_ptr(this_obj);
40093 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40094 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40095 GossipTimestampFilter_free(this_obj_conv);
40098 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
40099 LDKGossipTimestampFilter this_ptr_conv;
40100 this_ptr_conv.inner = untag_ptr(this_ptr);
40101 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40102 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40103 this_ptr_conv.is_owned = false;
40104 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
40105 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv));
40109 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1chain_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
40110 LDKGossipTimestampFilter this_ptr_conv;
40111 this_ptr_conv.inner = untag_ptr(this_ptr);
40112 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40113 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40114 this_ptr_conv.is_owned = false;
40115 LDKThirtyTwoBytes val_ref;
40116 CHECK((*env)->GetArrayLength(env, val) == 32);
40117 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
40118 GossipTimestampFilter_set_chain_hash(&this_ptr_conv, val_ref);
40121 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) {
40122 LDKGossipTimestampFilter this_ptr_conv;
40123 this_ptr_conv.inner = untag_ptr(this_ptr);
40124 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40125 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40126 this_ptr_conv.is_owned = false;
40127 int32_t ret_conv = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv);
40131 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1first_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
40132 LDKGossipTimestampFilter this_ptr_conv;
40133 this_ptr_conv.inner = untag_ptr(this_ptr);
40134 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40135 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40136 this_ptr_conv.is_owned = false;
40137 GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val);
40140 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range(JNIEnv *env, jclass clz, int64_t this_ptr) {
40141 LDKGossipTimestampFilter this_ptr_conv;
40142 this_ptr_conv.inner = untag_ptr(this_ptr);
40143 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40144 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40145 this_ptr_conv.is_owned = false;
40146 int32_t ret_conv = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv);
40150 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1timestamp_1range(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
40151 LDKGossipTimestampFilter this_ptr_conv;
40152 this_ptr_conv.inner = untag_ptr(this_ptr);
40153 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40154 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40155 this_ptr_conv.is_owned = false;
40156 GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val);
40159 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) {
40160 LDKThirtyTwoBytes chain_hash_arg_ref;
40161 CHECK((*env)->GetArrayLength(env, chain_hash_arg) == 32);
40162 (*env)->GetByteArrayRegion(env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
40163 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_arg);
40164 int64_t ret_ref = 0;
40165 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40166 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40170 static inline uint64_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) {
40171 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg);
40172 int64_t ret_ref = 0;
40173 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40174 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40177 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
40178 LDKGossipTimestampFilter arg_conv;
40179 arg_conv.inner = untag_ptr(arg);
40180 arg_conv.is_owned = ptr_is_owned(arg);
40181 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40182 arg_conv.is_owned = false;
40183 int64_t ret_conv = GossipTimestampFilter_clone_ptr(&arg_conv);
40187 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone(JNIEnv *env, jclass clz, int64_t orig) {
40188 LDKGossipTimestampFilter orig_conv;
40189 orig_conv.inner = untag_ptr(orig);
40190 orig_conv.is_owned = ptr_is_owned(orig);
40191 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40192 orig_conv.is_owned = false;
40193 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv);
40194 int64_t ret_ref = 0;
40195 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40196 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40200 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
40201 LDKGossipTimestampFilter a_conv;
40202 a_conv.inner = untag_ptr(a);
40203 a_conv.is_owned = ptr_is_owned(a);
40204 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
40205 a_conv.is_owned = false;
40206 LDKGossipTimestampFilter b_conv;
40207 b_conv.inner = untag_ptr(b);
40208 b_conv.is_owned = ptr_is_owned(b);
40209 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40210 b_conv.is_owned = false;
40211 jboolean ret_conv = GossipTimestampFilter_eq(&a_conv, &b_conv);
40215 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
40216 if (!ptr_is_owned(this_ptr)) return;
40217 void* this_ptr_ptr = untag_ptr(this_ptr);
40218 CHECK_ACCESS(this_ptr_ptr);
40219 LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr);
40220 FREE(untag_ptr(this_ptr));
40221 ErrorAction_free(this_ptr_conv);
40224 static inline uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) {
40225 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
40226 *ret_copy = ErrorAction_clone(arg);
40227 int64_t ret_ref = tag_ptr(ret_copy, true);
40230 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
40231 LDKErrorAction* arg_conv = (LDKErrorAction*)untag_ptr(arg);
40232 int64_t ret_conv = ErrorAction_clone_ptr(arg_conv);
40236 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
40237 LDKErrorAction* orig_conv = (LDKErrorAction*)untag_ptr(orig);
40238 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
40239 *ret_copy = ErrorAction_clone(orig_conv);
40240 int64_t ret_ref = tag_ptr(ret_copy, true);
40244 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1disconnect_1peer(JNIEnv *env, jclass clz, int64_t msg) {
40245 LDKErrorMessage msg_conv;
40246 msg_conv.inner = untag_ptr(msg);
40247 msg_conv.is_owned = ptr_is_owned(msg);
40248 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
40249 msg_conv = ErrorMessage_clone(&msg_conv);
40250 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
40251 *ret_copy = ErrorAction_disconnect_peer(msg_conv);
40252 int64_t ret_ref = tag_ptr(ret_copy, true);
40256 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1error(JNIEnv *env, jclass clz) {
40257 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
40258 *ret_copy = ErrorAction_ignore_error();
40259 int64_t ret_ref = tag_ptr(ret_copy, true);
40263 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1and_1log(JNIEnv *env, jclass clz, jclass a) {
40264 LDKLevel a_conv = LDKLevel_from_java(env, a);
40265 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
40266 *ret_copy = ErrorAction_ignore_and_log(a_conv);
40267 int64_t ret_ref = tag_ptr(ret_copy, true);
40271 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1duplicate_1gossip(JNIEnv *env, jclass clz) {
40272 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
40273 *ret_copy = ErrorAction_ignore_duplicate_gossip();
40274 int64_t ret_ref = tag_ptr(ret_copy, true);
40278 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1error_1message(JNIEnv *env, jclass clz, int64_t msg) {
40279 LDKErrorMessage msg_conv;
40280 msg_conv.inner = untag_ptr(msg);
40281 msg_conv.is_owned = ptr_is_owned(msg);
40282 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
40283 msg_conv = ErrorMessage_clone(&msg_conv);
40284 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
40285 *ret_copy = ErrorAction_send_error_message(msg_conv);
40286 int64_t ret_ref = tag_ptr(ret_copy, true);
40290 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1warning_1message(JNIEnv *env, jclass clz, int64_t msg, jclass log_level) {
40291 LDKWarningMessage msg_conv;
40292 msg_conv.inner = untag_ptr(msg);
40293 msg_conv.is_owned = ptr_is_owned(msg);
40294 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
40295 msg_conv = WarningMessage_clone(&msg_conv);
40296 LDKLevel log_level_conv = LDKLevel_from_java(env, log_level);
40297 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
40298 *ret_copy = ErrorAction_send_warning_message(msg_conv, log_level_conv);
40299 int64_t ret_ref = tag_ptr(ret_copy, true);
40303 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
40304 LDKLightningError this_obj_conv;
40305 this_obj_conv.inner = untag_ptr(this_obj);
40306 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40307 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40308 LightningError_free(this_obj_conv);
40311 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv *env, jclass clz, int64_t this_ptr) {
40312 LDKLightningError this_ptr_conv;
40313 this_ptr_conv.inner = untag_ptr(this_ptr);
40314 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40315 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40316 this_ptr_conv.is_owned = false;
40317 LDKStr ret_str = LightningError_get_err(&this_ptr_conv);
40318 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
40323 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) {
40324 LDKLightningError this_ptr_conv;
40325 this_ptr_conv.inner = untag_ptr(this_ptr);
40326 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40327 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40328 this_ptr_conv.is_owned = false;
40329 LDKStr val_conv = java_to_owned_str(env, val);
40330 LightningError_set_err(&this_ptr_conv, val_conv);
40333 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(JNIEnv *env, jclass clz, int64_t this_ptr) {
40334 LDKLightningError this_ptr_conv;
40335 this_ptr_conv.inner = untag_ptr(this_ptr);
40336 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40337 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40338 this_ptr_conv.is_owned = false;
40339 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
40340 *ret_copy = LightningError_get_action(&this_ptr_conv);
40341 int64_t ret_ref = tag_ptr(ret_copy, true);
40345 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
40346 LDKLightningError this_ptr_conv;
40347 this_ptr_conv.inner = untag_ptr(this_ptr);
40348 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40349 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40350 this_ptr_conv.is_owned = false;
40351 void* val_ptr = untag_ptr(val);
40352 CHECK_ACCESS(val_ptr);
40353 LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr);
40354 val_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(val));
40355 LightningError_set_action(&this_ptr_conv, val_conv);
40358 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv *env, jclass clz, jstring err_arg, int64_t action_arg) {
40359 LDKStr err_arg_conv = java_to_owned_str(env, err_arg);
40360 void* action_arg_ptr = untag_ptr(action_arg);
40361 CHECK_ACCESS(action_arg_ptr);
40362 LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr);
40363 action_arg_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action_arg));
40364 LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv);
40365 int64_t ret_ref = 0;
40366 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40367 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40371 static inline uint64_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) {
40372 LDKLightningError ret_var = LightningError_clone(arg);
40373 int64_t ret_ref = 0;
40374 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40375 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40378 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
40379 LDKLightningError arg_conv;
40380 arg_conv.inner = untag_ptr(arg);
40381 arg_conv.is_owned = ptr_is_owned(arg);
40382 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40383 arg_conv.is_owned = false;
40384 int64_t ret_conv = LightningError_clone_ptr(&arg_conv);
40388 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LightningError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
40389 LDKLightningError orig_conv;
40390 orig_conv.inner = untag_ptr(orig);
40391 orig_conv.is_owned = ptr_is_owned(orig);
40392 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40393 orig_conv.is_owned = false;
40394 LDKLightningError ret_var = LightningError_clone(&orig_conv);
40395 int64_t ret_ref = 0;
40396 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40397 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40401 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
40402 LDKCommitmentUpdate this_obj_conv;
40403 this_obj_conv.inner = untag_ptr(this_obj);
40404 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40405 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40406 CommitmentUpdate_free(this_obj_conv);
40409 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1add_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
40410 LDKCommitmentUpdate this_ptr_conv;
40411 this_ptr_conv.inner = untag_ptr(this_ptr);
40412 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40413 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40414 this_ptr_conv.is_owned = false;
40415 LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv);
40416 int64_tArray ret_arr = NULL;
40417 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
40418 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
40419 for (size_t p = 0; p < ret_var.datalen; p++) {
40420 LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p];
40421 int64_t ret_conv_15_ref = 0;
40422 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var);
40423 ret_conv_15_ref = tag_ptr(ret_conv_15_var.inner, ret_conv_15_var.is_owned);
40424 ret_arr_ptr[p] = ret_conv_15_ref;
40426 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
40427 FREE(ret_var.data);
40431 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
40432 LDKCommitmentUpdate this_ptr_conv;
40433 this_ptr_conv.inner = untag_ptr(this_ptr);
40434 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40435 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40436 this_ptr_conv.is_owned = false;
40437 LDKCVec_UpdateAddHTLCZ val_constr;
40438 val_constr.datalen = (*env)->GetArrayLength(env, val);
40439 if (val_constr.datalen > 0)
40440 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
40442 val_constr.data = NULL;
40443 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
40444 for (size_t p = 0; p < val_constr.datalen; p++) {
40445 int64_t val_conv_15 = val_vals[p];
40446 LDKUpdateAddHTLC val_conv_15_conv;
40447 val_conv_15_conv.inner = untag_ptr(val_conv_15);
40448 val_conv_15_conv.is_owned = ptr_is_owned(val_conv_15);
40449 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv);
40450 val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv);
40451 val_constr.data[p] = val_conv_15_conv;
40453 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
40454 CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr);
40457 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fulfill_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
40458 LDKCommitmentUpdate this_ptr_conv;
40459 this_ptr_conv.inner = untag_ptr(this_ptr);
40460 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40461 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40462 this_ptr_conv.is_owned = false;
40463 LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv);
40464 int64_tArray ret_arr = NULL;
40465 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
40466 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
40467 for (size_t t = 0; t < ret_var.datalen; t++) {
40468 LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t];
40469 int64_t ret_conv_19_ref = 0;
40470 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var);
40471 ret_conv_19_ref = tag_ptr(ret_conv_19_var.inner, ret_conv_19_var.is_owned);
40472 ret_arr_ptr[t] = ret_conv_19_ref;
40474 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
40475 FREE(ret_var.data);
40479 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
40480 LDKCommitmentUpdate this_ptr_conv;
40481 this_ptr_conv.inner = untag_ptr(this_ptr);
40482 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40483 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40484 this_ptr_conv.is_owned = false;
40485 LDKCVec_UpdateFulfillHTLCZ val_constr;
40486 val_constr.datalen = (*env)->GetArrayLength(env, val);
40487 if (val_constr.datalen > 0)
40488 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
40490 val_constr.data = NULL;
40491 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
40492 for (size_t t = 0; t < val_constr.datalen; t++) {
40493 int64_t val_conv_19 = val_vals[t];
40494 LDKUpdateFulfillHTLC val_conv_19_conv;
40495 val_conv_19_conv.inner = untag_ptr(val_conv_19);
40496 val_conv_19_conv.is_owned = ptr_is_owned(val_conv_19);
40497 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv);
40498 val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv);
40499 val_constr.data[t] = val_conv_19_conv;
40501 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
40502 CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr);
40505 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fail_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
40506 LDKCommitmentUpdate this_ptr_conv;
40507 this_ptr_conv.inner = untag_ptr(this_ptr);
40508 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40509 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40510 this_ptr_conv.is_owned = false;
40511 LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv);
40512 int64_tArray ret_arr = NULL;
40513 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
40514 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
40515 for (size_t q = 0; q < ret_var.datalen; q++) {
40516 LDKUpdateFailHTLC ret_conv_16_var = ret_var.data[q];
40517 int64_t ret_conv_16_ref = 0;
40518 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
40519 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
40520 ret_arr_ptr[q] = ret_conv_16_ref;
40522 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
40523 FREE(ret_var.data);
40527 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
40528 LDKCommitmentUpdate this_ptr_conv;
40529 this_ptr_conv.inner = untag_ptr(this_ptr);
40530 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40531 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40532 this_ptr_conv.is_owned = false;
40533 LDKCVec_UpdateFailHTLCZ val_constr;
40534 val_constr.datalen = (*env)->GetArrayLength(env, val);
40535 if (val_constr.datalen > 0)
40536 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
40538 val_constr.data = NULL;
40539 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
40540 for (size_t q = 0; q < val_constr.datalen; q++) {
40541 int64_t val_conv_16 = val_vals[q];
40542 LDKUpdateFailHTLC val_conv_16_conv;
40543 val_conv_16_conv.inner = untag_ptr(val_conv_16);
40544 val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16);
40545 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv);
40546 val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv);
40547 val_constr.data[q] = val_conv_16_conv;
40549 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
40550 CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr);
40553 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fail_1malformed_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) {
40554 LDKCommitmentUpdate this_ptr_conv;
40555 this_ptr_conv.inner = untag_ptr(this_ptr);
40556 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40557 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40558 this_ptr_conv.is_owned = false;
40559 LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv);
40560 int64_tArray ret_arr = NULL;
40561 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
40562 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
40563 for (size_t z = 0; z < ret_var.datalen; z++) {
40564 LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z];
40565 int64_t ret_conv_25_ref = 0;
40566 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var);
40567 ret_conv_25_ref = tag_ptr(ret_conv_25_var.inner, ret_conv_25_var.is_owned);
40568 ret_arr_ptr[z] = ret_conv_25_ref;
40570 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
40571 FREE(ret_var.data);
40575 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) {
40576 LDKCommitmentUpdate this_ptr_conv;
40577 this_ptr_conv.inner = untag_ptr(this_ptr);
40578 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40579 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40580 this_ptr_conv.is_owned = false;
40581 LDKCVec_UpdateFailMalformedHTLCZ val_constr;
40582 val_constr.datalen = (*env)->GetArrayLength(env, val);
40583 if (val_constr.datalen > 0)
40584 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
40586 val_constr.data = NULL;
40587 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
40588 for (size_t z = 0; z < val_constr.datalen; z++) {
40589 int64_t val_conv_25 = val_vals[z];
40590 LDKUpdateFailMalformedHTLC val_conv_25_conv;
40591 val_conv_25_conv.inner = untag_ptr(val_conv_25);
40592 val_conv_25_conv.is_owned = ptr_is_owned(val_conv_25);
40593 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv);
40594 val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv);
40595 val_constr.data[z] = val_conv_25_conv;
40597 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
40598 CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr);
40601 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv *env, jclass clz, int64_t this_ptr) {
40602 LDKCommitmentUpdate this_ptr_conv;
40603 this_ptr_conv.inner = untag_ptr(this_ptr);
40604 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40605 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40606 this_ptr_conv.is_owned = false;
40607 LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv);
40608 int64_t ret_ref = 0;
40609 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40610 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40614 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
40615 LDKCommitmentUpdate this_ptr_conv;
40616 this_ptr_conv.inner = untag_ptr(this_ptr);
40617 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40618 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40619 this_ptr_conv.is_owned = false;
40620 LDKUpdateFee val_conv;
40621 val_conv.inner = untag_ptr(val);
40622 val_conv.is_owned = ptr_is_owned(val);
40623 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40624 val_conv = UpdateFee_clone(&val_conv);
40625 CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv);
40628 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_ptr) {
40629 LDKCommitmentUpdate this_ptr_conv;
40630 this_ptr_conv.inner = untag_ptr(this_ptr);
40631 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40632 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40633 this_ptr_conv.is_owned = false;
40634 LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv);
40635 int64_t ret_ref = 0;
40636 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40637 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40641 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
40642 LDKCommitmentUpdate this_ptr_conv;
40643 this_ptr_conv.inner = untag_ptr(this_ptr);
40644 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40645 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40646 this_ptr_conv.is_owned = false;
40647 LDKCommitmentSigned val_conv;
40648 val_conv.inner = untag_ptr(val);
40649 val_conv.is_owned = ptr_is_owned(val);
40650 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40651 val_conv = CommitmentSigned_clone(&val_conv);
40652 CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv);
40655 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) {
40656 LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_constr;
40657 update_add_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_add_htlcs_arg);
40658 if (update_add_htlcs_arg_constr.datalen > 0)
40659 update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
40661 update_add_htlcs_arg_constr.data = NULL;
40662 int64_t* update_add_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_add_htlcs_arg, NULL);
40663 for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) {
40664 int64_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p];
40665 LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv;
40666 update_add_htlcs_arg_conv_15_conv.inner = untag_ptr(update_add_htlcs_arg_conv_15);
40667 update_add_htlcs_arg_conv_15_conv.is_owned = ptr_is_owned(update_add_htlcs_arg_conv_15);
40668 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv);
40669 update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv);
40670 update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv;
40672 (*env)->ReleaseLongArrayElements(env, update_add_htlcs_arg, update_add_htlcs_arg_vals, 0);
40673 LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr;
40674 update_fulfill_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fulfill_htlcs_arg);
40675 if (update_fulfill_htlcs_arg_constr.datalen > 0)
40676 update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
40678 update_fulfill_htlcs_arg_constr.data = NULL;
40679 int64_t* update_fulfill_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fulfill_htlcs_arg, NULL);
40680 for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) {
40681 int64_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t];
40682 LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv;
40683 update_fulfill_htlcs_arg_conv_19_conv.inner = untag_ptr(update_fulfill_htlcs_arg_conv_19);
40684 update_fulfill_htlcs_arg_conv_19_conv.is_owned = ptr_is_owned(update_fulfill_htlcs_arg_conv_19);
40685 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv);
40686 update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv);
40687 update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv;
40689 (*env)->ReleaseLongArrayElements(env, update_fulfill_htlcs_arg, update_fulfill_htlcs_arg_vals, 0);
40690 LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr;
40691 update_fail_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fail_htlcs_arg);
40692 if (update_fail_htlcs_arg_constr.datalen > 0)
40693 update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
40695 update_fail_htlcs_arg_constr.data = NULL;
40696 int64_t* update_fail_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fail_htlcs_arg, NULL);
40697 for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) {
40698 int64_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q];
40699 LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv;
40700 update_fail_htlcs_arg_conv_16_conv.inner = untag_ptr(update_fail_htlcs_arg_conv_16);
40701 update_fail_htlcs_arg_conv_16_conv.is_owned = ptr_is_owned(update_fail_htlcs_arg_conv_16);
40702 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv);
40703 update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv);
40704 update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv;
40706 (*env)->ReleaseLongArrayElements(env, update_fail_htlcs_arg, update_fail_htlcs_arg_vals, 0);
40707 LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr;
40708 update_fail_malformed_htlcs_arg_constr.datalen = (*env)->GetArrayLength(env, update_fail_malformed_htlcs_arg);
40709 if (update_fail_malformed_htlcs_arg_constr.datalen > 0)
40710 update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
40712 update_fail_malformed_htlcs_arg_constr.data = NULL;
40713 int64_t* update_fail_malformed_htlcs_arg_vals = (*env)->GetLongArrayElements (env, update_fail_malformed_htlcs_arg, NULL);
40714 for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) {
40715 int64_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z];
40716 LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv;
40717 update_fail_malformed_htlcs_arg_conv_25_conv.inner = untag_ptr(update_fail_malformed_htlcs_arg_conv_25);
40718 update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = ptr_is_owned(update_fail_malformed_htlcs_arg_conv_25);
40719 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv);
40720 update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv);
40721 update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv;
40723 (*env)->ReleaseLongArrayElements(env, update_fail_malformed_htlcs_arg, update_fail_malformed_htlcs_arg_vals, 0);
40724 LDKUpdateFee update_fee_arg_conv;
40725 update_fee_arg_conv.inner = untag_ptr(update_fee_arg);
40726 update_fee_arg_conv.is_owned = ptr_is_owned(update_fee_arg);
40727 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv);
40728 update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv);
40729 LDKCommitmentSigned commitment_signed_arg_conv;
40730 commitment_signed_arg_conv.inner = untag_ptr(commitment_signed_arg);
40731 commitment_signed_arg_conv.is_owned = ptr_is_owned(commitment_signed_arg);
40732 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv);
40733 commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv);
40734 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);
40735 int64_t ret_ref = 0;
40736 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40737 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40741 static inline uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) {
40742 LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg);
40743 int64_t ret_ref = 0;
40744 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40745 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40748 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
40749 LDKCommitmentUpdate arg_conv;
40750 arg_conv.inner = untag_ptr(arg);
40751 arg_conv.is_owned = ptr_is_owned(arg);
40752 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40753 arg_conv.is_owned = false;
40754 int64_t ret_conv = CommitmentUpdate_clone_ptr(&arg_conv);
40758 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
40759 LDKCommitmentUpdate orig_conv;
40760 orig_conv.inner = untag_ptr(orig);
40761 orig_conv.is_owned = ptr_is_owned(orig);
40762 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40763 orig_conv.is_owned = false;
40764 LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv);
40765 int64_t ret_ref = 0;
40766 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40767 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40771 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
40772 LDKCommitmentUpdate a_conv;
40773 a_conv.inner = untag_ptr(a);
40774 a_conv.is_owned = ptr_is_owned(a);
40775 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
40776 a_conv.is_owned = false;
40777 LDKCommitmentUpdate b_conv;
40778 b_conv.inner = untag_ptr(b);
40779 b_conv.is_owned = ptr_is_owned(b);
40780 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40781 b_conv.is_owned = false;
40782 jboolean ret_conv = CommitmentUpdate_eq(&a_conv, &b_conv);
40786 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
40787 if (!ptr_is_owned(this_ptr)) return;
40788 void* this_ptr_ptr = untag_ptr(this_ptr);
40789 CHECK_ACCESS(this_ptr_ptr);
40790 LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr);
40791 FREE(untag_ptr(this_ptr));
40792 ChannelMessageHandler_free(this_ptr_conv);
40795 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
40796 if (!ptr_is_owned(this_ptr)) return;
40797 void* this_ptr_ptr = untag_ptr(this_ptr);
40798 CHECK_ACCESS(this_ptr_ptr);
40799 LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr);
40800 FREE(untag_ptr(this_ptr));
40801 RoutingMessageHandler_free(this_ptr_conv);
40804 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
40805 if (!ptr_is_owned(this_ptr)) return;
40806 void* this_ptr_ptr = untag_ptr(this_ptr);
40807 CHECK_ACCESS(this_ptr_ptr);
40808 LDKOnionMessageHandler this_ptr_conv = *(LDKOnionMessageHandler*)(this_ptr_ptr);
40809 FREE(untag_ptr(this_ptr));
40810 OnionMessageHandler_free(this_ptr_conv);
40813 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv *env, jclass clz, int64_t obj) {
40814 LDKAcceptChannel obj_conv;
40815 obj_conv.inner = untag_ptr(obj);
40816 obj_conv.is_owned = ptr_is_owned(obj);
40817 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40818 obj_conv.is_owned = false;
40819 LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv);
40820 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40821 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40822 CVec_u8Z_free(ret_var);
40826 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40827 LDKu8slice ser_ref;
40828 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40829 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40830 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
40831 *ret_conv = AcceptChannel_read(ser_ref);
40832 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40833 return tag_ptr(ret_conv, true);
40836 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
40837 LDKAnnouncementSignatures obj_conv;
40838 obj_conv.inner = untag_ptr(obj);
40839 obj_conv.is_owned = ptr_is_owned(obj);
40840 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40841 obj_conv.is_owned = false;
40842 LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv);
40843 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40844 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40845 CVec_u8Z_free(ret_var);
40849 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40850 LDKu8slice ser_ref;
40851 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40852 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40853 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
40854 *ret_conv = AnnouncementSignatures_read(ser_ref);
40855 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40856 return tag_ptr(ret_conv, true);
40859 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv *env, jclass clz, int64_t obj) {
40860 LDKChannelReestablish obj_conv;
40861 obj_conv.inner = untag_ptr(obj);
40862 obj_conv.is_owned = ptr_is_owned(obj);
40863 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40864 obj_conv.is_owned = false;
40865 LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv);
40866 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40867 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40868 CVec_u8Z_free(ret_var);
40872 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40873 LDKu8slice ser_ref;
40874 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40875 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40876 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
40877 *ret_conv = ChannelReestablish_read(ser_ref);
40878 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40879 return tag_ptr(ret_conv, true);
40882 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv *env, jclass clz, int64_t obj) {
40883 LDKClosingSigned obj_conv;
40884 obj_conv.inner = untag_ptr(obj);
40885 obj_conv.is_owned = ptr_is_owned(obj);
40886 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40887 obj_conv.is_owned = false;
40888 LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv);
40889 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40890 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40891 CVec_u8Z_free(ret_var);
40895 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40896 LDKu8slice ser_ref;
40897 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40898 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40899 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
40900 *ret_conv = ClosingSigned_read(ser_ref);
40901 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40902 return tag_ptr(ret_conv, true);
40905 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1write(JNIEnv *env, jclass clz, int64_t obj) {
40906 LDKClosingSignedFeeRange obj_conv;
40907 obj_conv.inner = untag_ptr(obj);
40908 obj_conv.is_owned = ptr_is_owned(obj);
40909 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40910 obj_conv.is_owned = false;
40911 LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv);
40912 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40913 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40914 CVec_u8Z_free(ret_var);
40918 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40919 LDKu8slice ser_ref;
40920 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40921 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40922 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
40923 *ret_conv = ClosingSignedFeeRange_read(ser_ref);
40924 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40925 return tag_ptr(ret_conv, true);
40928 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv *env, jclass clz, int64_t obj) {
40929 LDKCommitmentSigned obj_conv;
40930 obj_conv.inner = untag_ptr(obj);
40931 obj_conv.is_owned = ptr_is_owned(obj);
40932 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40933 obj_conv.is_owned = false;
40934 LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv);
40935 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40936 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40937 CVec_u8Z_free(ret_var);
40941 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40942 LDKu8slice ser_ref;
40943 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40944 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40945 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
40946 *ret_conv = CommitmentSigned_read(ser_ref);
40947 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40948 return tag_ptr(ret_conv, true);
40951 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv *env, jclass clz, int64_t obj) {
40952 LDKFundingCreated obj_conv;
40953 obj_conv.inner = untag_ptr(obj);
40954 obj_conv.is_owned = ptr_is_owned(obj);
40955 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40956 obj_conv.is_owned = false;
40957 LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv);
40958 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40959 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40960 CVec_u8Z_free(ret_var);
40964 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40965 LDKu8slice ser_ref;
40966 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40967 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40968 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
40969 *ret_conv = FundingCreated_read(ser_ref);
40970 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40971 return tag_ptr(ret_conv, true);
40974 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv *env, jclass clz, int64_t obj) {
40975 LDKFundingSigned obj_conv;
40976 obj_conv.inner = untag_ptr(obj);
40977 obj_conv.is_owned = ptr_is_owned(obj);
40978 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40979 obj_conv.is_owned = false;
40980 LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv);
40981 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
40982 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
40983 CVec_u8Z_free(ret_var);
40987 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
40988 LDKu8slice ser_ref;
40989 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
40990 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
40991 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
40992 *ret_conv = FundingSigned_read(ser_ref);
40993 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
40994 return tag_ptr(ret_conv, true);
40997 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelReady_1write(JNIEnv *env, jclass clz, int64_t obj) {
40998 LDKChannelReady obj_conv;
40999 obj_conv.inner = untag_ptr(obj);
41000 obj_conv.is_owned = ptr_is_owned(obj);
41001 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41002 obj_conv.is_owned = false;
41003 LDKCVec_u8Z ret_var = ChannelReady_write(&obj_conv);
41004 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41005 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41006 CVec_u8Z_free(ret_var);
41010 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelReady_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41011 LDKu8slice ser_ref;
41012 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41013 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41014 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
41015 *ret_conv = ChannelReady_read(ser_ref);
41016 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41017 return tag_ptr(ret_conv, true);
41020 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv *env, jclass clz, int64_t obj) {
41022 obj_conv.inner = untag_ptr(obj);
41023 obj_conv.is_owned = ptr_is_owned(obj);
41024 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41025 obj_conv.is_owned = false;
41026 LDKCVec_u8Z ret_var = Init_write(&obj_conv);
41027 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41028 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41029 CVec_u8Z_free(ret_var);
41033 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41034 LDKu8slice ser_ref;
41035 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41036 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41037 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
41038 *ret_conv = Init_read(ser_ref);
41039 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41040 return tag_ptr(ret_conv, true);
41043 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv *env, jclass clz, int64_t obj) {
41044 LDKOpenChannel obj_conv;
41045 obj_conv.inner = untag_ptr(obj);
41046 obj_conv.is_owned = ptr_is_owned(obj);
41047 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41048 obj_conv.is_owned = false;
41049 LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv);
41050 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41051 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41052 CVec_u8Z_free(ret_var);
41056 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41057 LDKu8slice ser_ref;
41058 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41059 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41060 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
41061 *ret_conv = OpenChannel_read(ser_ref);
41062 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41063 return tag_ptr(ret_conv, true);
41066 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv *env, jclass clz, int64_t obj) {
41067 LDKRevokeAndACK obj_conv;
41068 obj_conv.inner = untag_ptr(obj);
41069 obj_conv.is_owned = ptr_is_owned(obj);
41070 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41071 obj_conv.is_owned = false;
41072 LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv);
41073 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41074 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41075 CVec_u8Z_free(ret_var);
41079 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41080 LDKu8slice ser_ref;
41081 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41082 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41083 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
41084 *ret_conv = RevokeAndACK_read(ser_ref);
41085 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41086 return tag_ptr(ret_conv, true);
41089 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv *env, jclass clz, int64_t obj) {
41090 LDKShutdown obj_conv;
41091 obj_conv.inner = untag_ptr(obj);
41092 obj_conv.is_owned = ptr_is_owned(obj);
41093 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41094 obj_conv.is_owned = false;
41095 LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv);
41096 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41097 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41098 CVec_u8Z_free(ret_var);
41102 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41103 LDKu8slice ser_ref;
41104 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41105 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41106 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
41107 *ret_conv = Shutdown_read(ser_ref);
41108 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41109 return tag_ptr(ret_conv, true);
41112 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) {
41113 LDKUpdateFailHTLC obj_conv;
41114 obj_conv.inner = untag_ptr(obj);
41115 obj_conv.is_owned = ptr_is_owned(obj);
41116 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41117 obj_conv.is_owned = false;
41118 LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv);
41119 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41120 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41121 CVec_u8Z_free(ret_var);
41125 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41126 LDKu8slice ser_ref;
41127 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41128 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41129 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
41130 *ret_conv = UpdateFailHTLC_read(ser_ref);
41131 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41132 return tag_ptr(ret_conv, true);
41135 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) {
41136 LDKUpdateFailMalformedHTLC obj_conv;
41137 obj_conv.inner = untag_ptr(obj);
41138 obj_conv.is_owned = ptr_is_owned(obj);
41139 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41140 obj_conv.is_owned = false;
41141 LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv);
41142 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41143 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41144 CVec_u8Z_free(ret_var);
41148 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41149 LDKu8slice ser_ref;
41150 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41151 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41152 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
41153 *ret_conv = UpdateFailMalformedHTLC_read(ser_ref);
41154 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41155 return tag_ptr(ret_conv, true);
41158 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv *env, jclass clz, int64_t obj) {
41159 LDKUpdateFee obj_conv;
41160 obj_conv.inner = untag_ptr(obj);
41161 obj_conv.is_owned = ptr_is_owned(obj);
41162 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41163 obj_conv.is_owned = false;
41164 LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv);
41165 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41166 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41167 CVec_u8Z_free(ret_var);
41171 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41172 LDKu8slice ser_ref;
41173 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41174 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41175 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
41176 *ret_conv = UpdateFee_read(ser_ref);
41177 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41178 return tag_ptr(ret_conv, true);
41181 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) {
41182 LDKUpdateFulfillHTLC obj_conv;
41183 obj_conv.inner = untag_ptr(obj);
41184 obj_conv.is_owned = ptr_is_owned(obj);
41185 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41186 obj_conv.is_owned = false;
41187 LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv);
41188 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41189 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41190 CVec_u8Z_free(ret_var);
41194 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41195 LDKu8slice ser_ref;
41196 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41197 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41198 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
41199 *ret_conv = UpdateFulfillHTLC_read(ser_ref);
41200 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41201 return tag_ptr(ret_conv, true);
41204 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv *env, jclass clz, int64_t obj) {
41205 LDKUpdateAddHTLC obj_conv;
41206 obj_conv.inner = untag_ptr(obj);
41207 obj_conv.is_owned = ptr_is_owned(obj);
41208 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41209 obj_conv.is_owned = false;
41210 LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv);
41211 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41212 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41213 CVec_u8Z_free(ret_var);
41217 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41218 LDKu8slice ser_ref;
41219 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41220 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41221 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
41222 *ret_conv = UpdateAddHTLC_read(ser_ref);
41223 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41224 return tag_ptr(ret_conv, true);
41227 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessage_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41228 LDKu8slice ser_ref;
41229 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41230 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41231 LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
41232 *ret_conv = OnionMessage_read(ser_ref);
41233 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41234 return tag_ptr(ret_conv, true);
41237 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OnionMessage_1write(JNIEnv *env, jclass clz, int64_t obj) {
41238 LDKOnionMessage obj_conv;
41239 obj_conv.inner = untag_ptr(obj);
41240 obj_conv.is_owned = ptr_is_owned(obj);
41241 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41242 obj_conv.is_owned = false;
41243 LDKCVec_u8Z ret_var = OnionMessage_write(&obj_conv);
41244 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41245 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41246 CVec_u8Z_free(ret_var);
41250 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv *env, jclass clz, int64_t obj) {
41252 obj_conv.inner = untag_ptr(obj);
41253 obj_conv.is_owned = ptr_is_owned(obj);
41254 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41255 obj_conv.is_owned = false;
41256 LDKCVec_u8Z ret_var = Ping_write(&obj_conv);
41257 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41258 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41259 CVec_u8Z_free(ret_var);
41263 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41264 LDKu8slice ser_ref;
41265 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41266 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41267 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
41268 *ret_conv = Ping_read(ser_ref);
41269 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41270 return tag_ptr(ret_conv, true);
41273 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv *env, jclass clz, int64_t obj) {
41275 obj_conv.inner = untag_ptr(obj);
41276 obj_conv.is_owned = ptr_is_owned(obj);
41277 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41278 obj_conv.is_owned = false;
41279 LDKCVec_u8Z ret_var = Pong_write(&obj_conv);
41280 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41281 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41282 CVec_u8Z_free(ret_var);
41286 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41287 LDKu8slice ser_ref;
41288 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41289 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41290 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
41291 *ret_conv = Pong_read(ser_ref);
41292 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41293 return tag_ptr(ret_conv, true);
41296 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) {
41297 LDKUnsignedChannelAnnouncement obj_conv;
41298 obj_conv.inner = untag_ptr(obj);
41299 obj_conv.is_owned = ptr_is_owned(obj);
41300 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41301 obj_conv.is_owned = false;
41302 LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv);
41303 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41304 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41305 CVec_u8Z_free(ret_var);
41309 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41310 LDKu8slice ser_ref;
41311 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41312 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41313 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
41314 *ret_conv = UnsignedChannelAnnouncement_read(ser_ref);
41315 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41316 return tag_ptr(ret_conv, true);
41319 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) {
41320 LDKChannelAnnouncement obj_conv;
41321 obj_conv.inner = untag_ptr(obj);
41322 obj_conv.is_owned = ptr_is_owned(obj);
41323 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41324 obj_conv.is_owned = false;
41325 LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv);
41326 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41327 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41328 CVec_u8Z_free(ret_var);
41332 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41333 LDKu8slice ser_ref;
41334 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41335 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41336 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
41337 *ret_conv = ChannelAnnouncement_read(ser_ref);
41338 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41339 return tag_ptr(ret_conv, true);
41342 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
41343 LDKUnsignedChannelUpdate obj_conv;
41344 obj_conv.inner = untag_ptr(obj);
41345 obj_conv.is_owned = ptr_is_owned(obj);
41346 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41347 obj_conv.is_owned = false;
41348 LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv);
41349 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41350 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41351 CVec_u8Z_free(ret_var);
41355 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41356 LDKu8slice ser_ref;
41357 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41358 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41359 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
41360 *ret_conv = UnsignedChannelUpdate_read(ser_ref);
41361 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41362 return tag_ptr(ret_conv, true);
41365 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
41366 LDKChannelUpdate obj_conv;
41367 obj_conv.inner = untag_ptr(obj);
41368 obj_conv.is_owned = ptr_is_owned(obj);
41369 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41370 obj_conv.is_owned = false;
41371 LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv);
41372 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41373 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41374 CVec_u8Z_free(ret_var);
41378 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41379 LDKu8slice ser_ref;
41380 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41381 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41382 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
41383 *ret_conv = ChannelUpdate_read(ser_ref);
41384 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41385 return tag_ptr(ret_conv, true);
41388 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv *env, jclass clz, int64_t obj) {
41389 LDKErrorMessage obj_conv;
41390 obj_conv.inner = untag_ptr(obj);
41391 obj_conv.is_owned = ptr_is_owned(obj);
41392 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41393 obj_conv.is_owned = false;
41394 LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv);
41395 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41396 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41397 CVec_u8Z_free(ret_var);
41401 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41402 LDKu8slice ser_ref;
41403 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41404 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41405 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
41406 *ret_conv = ErrorMessage_read(ser_ref);
41407 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41408 return tag_ptr(ret_conv, true);
41411 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_WarningMessage_1write(JNIEnv *env, jclass clz, int64_t obj) {
41412 LDKWarningMessage obj_conv;
41413 obj_conv.inner = untag_ptr(obj);
41414 obj_conv.is_owned = ptr_is_owned(obj);
41415 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41416 obj_conv.is_owned = false;
41417 LDKCVec_u8Z ret_var = WarningMessage_write(&obj_conv);
41418 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41419 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41420 CVec_u8Z_free(ret_var);
41424 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WarningMessage_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41425 LDKu8slice ser_ref;
41426 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41427 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41428 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
41429 *ret_conv = WarningMessage_read(ser_ref);
41430 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41431 return tag_ptr(ret_conv, true);
41434 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) {
41435 LDKUnsignedNodeAnnouncement obj_conv;
41436 obj_conv.inner = untag_ptr(obj);
41437 obj_conv.is_owned = ptr_is_owned(obj);
41438 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41439 obj_conv.is_owned = false;
41440 LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv);
41441 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41442 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41443 CVec_u8Z_free(ret_var);
41447 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41448 LDKu8slice ser_ref;
41449 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41450 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41451 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
41452 *ret_conv = UnsignedNodeAnnouncement_read(ser_ref);
41453 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41454 return tag_ptr(ret_conv, true);
41457 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv *env, jclass clz, int64_t obj) {
41458 LDKNodeAnnouncement obj_conv;
41459 obj_conv.inner = untag_ptr(obj);
41460 obj_conv.is_owned = ptr_is_owned(obj);
41461 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41462 obj_conv.is_owned = false;
41463 LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv);
41464 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41465 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41466 CVec_u8Z_free(ret_var);
41470 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41471 LDKu8slice ser_ref;
41472 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41473 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41474 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
41475 *ret_conv = NodeAnnouncement_read(ser_ref);
41476 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41477 return tag_ptr(ret_conv, true);
41480 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41481 LDKu8slice ser_ref;
41482 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41483 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41484 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
41485 *ret_conv = QueryShortChannelIds_read(ser_ref);
41486 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41487 return tag_ptr(ret_conv, true);
41490 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv *env, jclass clz, int64_t obj) {
41491 LDKQueryShortChannelIds obj_conv;
41492 obj_conv.inner = untag_ptr(obj);
41493 obj_conv.is_owned = ptr_is_owned(obj);
41494 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41495 obj_conv.is_owned = false;
41496 LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv);
41497 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41498 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41499 CVec_u8Z_free(ret_var);
41503 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write(JNIEnv *env, jclass clz, int64_t obj) {
41504 LDKReplyShortChannelIdsEnd obj_conv;
41505 obj_conv.inner = untag_ptr(obj);
41506 obj_conv.is_owned = ptr_is_owned(obj);
41507 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41508 obj_conv.is_owned = false;
41509 LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv);
41510 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41511 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41512 CVec_u8Z_free(ret_var);
41516 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41517 LDKu8slice ser_ref;
41518 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41519 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41520 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
41521 *ret_conv = ReplyShortChannelIdsEnd_read(ser_ref);
41522 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41523 return tag_ptr(ret_conv, true);
41526 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1end_1blocknum(JNIEnv *env, jclass clz, int64_t this_arg) {
41527 LDKQueryChannelRange this_arg_conv;
41528 this_arg_conv.inner = untag_ptr(this_arg);
41529 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41530 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41531 this_arg_conv.is_owned = false;
41532 int32_t ret_conv = QueryChannelRange_end_blocknum(&this_arg_conv);
41536 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv *env, jclass clz, int64_t obj) {
41537 LDKQueryChannelRange obj_conv;
41538 obj_conv.inner = untag_ptr(obj);
41539 obj_conv.is_owned = ptr_is_owned(obj);
41540 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41541 obj_conv.is_owned = false;
41542 LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv);
41543 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41544 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41545 CVec_u8Z_free(ret_var);
41549 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41550 LDKu8slice ser_ref;
41551 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41552 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41553 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
41554 *ret_conv = QueryChannelRange_read(ser_ref);
41555 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41556 return tag_ptr(ret_conv, true);
41559 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41560 LDKu8slice ser_ref;
41561 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41562 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41563 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
41564 *ret_conv = ReplyChannelRange_read(ser_ref);
41565 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41566 return tag_ptr(ret_conv, true);
41569 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv *env, jclass clz, int64_t obj) {
41570 LDKReplyChannelRange obj_conv;
41571 obj_conv.inner = untag_ptr(obj);
41572 obj_conv.is_owned = ptr_is_owned(obj);
41573 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41574 obj_conv.is_owned = false;
41575 LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv);
41576 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41577 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41578 CVec_u8Z_free(ret_var);
41582 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write(JNIEnv *env, jclass clz, int64_t obj) {
41583 LDKGossipTimestampFilter obj_conv;
41584 obj_conv.inner = untag_ptr(obj);
41585 obj_conv.is_owned = ptr_is_owned(obj);
41586 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41587 obj_conv.is_owned = false;
41588 LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv);
41589 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
41590 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
41591 CVec_u8Z_free(ret_var);
41595 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
41596 LDKu8slice ser_ref;
41597 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
41598 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
41599 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
41600 *ret_conv = GossipTimestampFilter_read(ser_ref);
41601 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
41602 return tag_ptr(ret_conv, true);
41605 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
41606 if (!ptr_is_owned(this_ptr)) return;
41607 void* this_ptr_ptr = untag_ptr(this_ptr);
41608 CHECK_ACCESS(this_ptr_ptr);
41609 LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr);
41610 FREE(untag_ptr(this_ptr));
41611 CustomMessageHandler_free(this_ptr_conv);
41614 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41615 LDKIgnoringMessageHandler this_obj_conv;
41616 this_obj_conv.inner = untag_ptr(this_obj);
41617 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41618 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41619 IgnoringMessageHandler_free(this_obj_conv);
41622 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1new(JNIEnv *env, jclass clz) {
41623 LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new();
41624 int64_t ret_ref = 0;
41625 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41626 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41630 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
41631 LDKIgnoringMessageHandler this_arg_conv;
41632 this_arg_conv.inner = untag_ptr(this_arg);
41633 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41634 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41635 this_arg_conv.is_owned = false;
41636 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
41637 *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
41638 return tag_ptr(ret_ret, true);
41641 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
41642 LDKIgnoringMessageHandler this_arg_conv;
41643 this_arg_conv.inner = untag_ptr(this_arg);
41644 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41645 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41646 this_arg_conv.is_owned = false;
41647 LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
41648 *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv);
41649 return tag_ptr(ret_ret, true);
41652 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1OnionMessageProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
41653 LDKIgnoringMessageHandler this_arg_conv;
41654 this_arg_conv.inner = untag_ptr(this_arg);
41655 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41656 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41657 this_arg_conv.is_owned = false;
41658 LDKOnionMessageProvider* ret_ret = MALLOC(sizeof(LDKOnionMessageProvider), "LDKOnionMessageProvider");
41659 *ret_ret = IgnoringMessageHandler_as_OnionMessageProvider(&this_arg_conv);
41660 return tag_ptr(ret_ret, true);
41663 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1OnionMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
41664 LDKIgnoringMessageHandler this_arg_conv;
41665 this_arg_conv.inner = untag_ptr(this_arg);
41666 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41667 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41668 this_arg_conv.is_owned = false;
41669 LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler");
41670 *ret_ret = IgnoringMessageHandler_as_OnionMessageHandler(&this_arg_conv);
41671 return tag_ptr(ret_ret, true);
41674 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomOnionMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
41675 LDKIgnoringMessageHandler this_arg_conv;
41676 this_arg_conv.inner = untag_ptr(this_arg);
41677 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41678 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41679 this_arg_conv.is_owned = false;
41680 LDKCustomOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageHandler), "LDKCustomOnionMessageHandler");
41681 *ret_ret = IgnoringMessageHandler_as_CustomOnionMessageHandler(&this_arg_conv);
41682 return tag_ptr(ret_ret, true);
41685 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomMessageReader(JNIEnv *env, jclass clz, int64_t this_arg) {
41686 LDKIgnoringMessageHandler this_arg_conv;
41687 this_arg_conv.inner = untag_ptr(this_arg);
41688 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41689 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41690 this_arg_conv.is_owned = false;
41691 LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
41692 *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv);
41693 return tag_ptr(ret_ret, true);
41696 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
41697 LDKIgnoringMessageHandler this_arg_conv;
41698 this_arg_conv.inner = untag_ptr(this_arg);
41699 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41700 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41701 this_arg_conv.is_owned = false;
41702 LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
41703 *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv);
41704 return tag_ptr(ret_ret, true);
41707 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41708 LDKErroringMessageHandler this_obj_conv;
41709 this_obj_conv.inner = untag_ptr(this_obj);
41710 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41711 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41712 ErroringMessageHandler_free(this_obj_conv);
41715 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1new(JNIEnv *env, jclass clz) {
41716 LDKErroringMessageHandler ret_var = ErroringMessageHandler_new();
41717 int64_t ret_ref = 0;
41718 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41719 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41723 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
41724 LDKErroringMessageHandler this_arg_conv;
41725 this_arg_conv.inner = untag_ptr(this_arg);
41726 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41727 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41728 this_arg_conv.is_owned = false;
41729 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
41730 *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
41731 return tag_ptr(ret_ret, true);
41734 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErroringMessageHandler_1as_1ChannelMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
41735 LDKErroringMessageHandler this_arg_conv;
41736 this_arg_conv.inner = untag_ptr(this_arg);
41737 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41738 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41739 this_arg_conv.is_owned = false;
41740 LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
41741 *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv);
41742 return tag_ptr(ret_ret, true);
41745 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41746 LDKMessageHandler this_obj_conv;
41747 this_obj_conv.inner = untag_ptr(this_obj);
41748 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41749 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41750 MessageHandler_free(this_obj_conv);
41753 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) {
41754 LDKMessageHandler this_ptr_conv;
41755 this_ptr_conv.inner = untag_ptr(this_ptr);
41756 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41757 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41758 this_ptr_conv.is_owned = false;
41759 // WARNING: This object doesn't live past this scope, needs clone!
41760 int64_t ret_ret = tag_ptr(MessageHandler_get_chan_handler(&this_ptr_conv), false);
41764 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41765 LDKMessageHandler this_ptr_conv;
41766 this_ptr_conv.inner = untag_ptr(this_ptr);
41767 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41768 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41769 this_ptr_conv.is_owned = false;
41770 void* val_ptr = untag_ptr(val);
41771 CHECK_ACCESS(val_ptr);
41772 LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr);
41773 if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
41774 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41775 LDKChannelMessageHandler_JCalls_cloned(&val_conv);
41777 MessageHandler_set_chan_handler(&this_ptr_conv, val_conv);
41780 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) {
41781 LDKMessageHandler this_ptr_conv;
41782 this_ptr_conv.inner = untag_ptr(this_ptr);
41783 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41784 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41785 this_ptr_conv.is_owned = false;
41786 // WARNING: This object doesn't live past this scope, needs clone!
41787 int64_t ret_ret = tag_ptr(MessageHandler_get_route_handler(&this_ptr_conv), false);
41791 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41792 LDKMessageHandler this_ptr_conv;
41793 this_ptr_conv.inner = untag_ptr(this_ptr);
41794 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41795 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41796 this_ptr_conv.is_owned = false;
41797 void* val_ptr = untag_ptr(val);
41798 CHECK_ACCESS(val_ptr);
41799 LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr);
41800 if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
41801 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41802 LDKRoutingMessageHandler_JCalls_cloned(&val_conv);
41804 MessageHandler_set_route_handler(&this_ptr_conv, val_conv);
41807 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1onion_1message_1handler(JNIEnv *env, jclass clz, int64_t this_ptr) {
41808 LDKMessageHandler this_ptr_conv;
41809 this_ptr_conv.inner = untag_ptr(this_ptr);
41810 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41811 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41812 this_ptr_conv.is_owned = false;
41813 // WARNING: This object doesn't live past this scope, needs clone!
41814 int64_t ret_ret = tag_ptr(MessageHandler_get_onion_message_handler(&this_ptr_conv), false);
41818 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1onion_1message_1handler(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
41819 LDKMessageHandler this_ptr_conv;
41820 this_ptr_conv.inner = untag_ptr(this_ptr);
41821 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41822 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41823 this_ptr_conv.is_owned = false;
41824 void* val_ptr = untag_ptr(val);
41825 CHECK_ACCESS(val_ptr);
41826 LDKOnionMessageHandler val_conv = *(LDKOnionMessageHandler*)(val_ptr);
41827 if (val_conv.free == LDKOnionMessageHandler_JCalls_free) {
41828 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41829 LDKOnionMessageHandler_JCalls_cloned(&val_conv);
41831 MessageHandler_set_onion_message_handler(&this_ptr_conv, val_conv);
41834 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) {
41835 void* chan_handler_arg_ptr = untag_ptr(chan_handler_arg);
41836 CHECK_ACCESS(chan_handler_arg_ptr);
41837 LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr);
41838 if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
41839 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41840 LDKChannelMessageHandler_JCalls_cloned(&chan_handler_arg_conv);
41842 void* route_handler_arg_ptr = untag_ptr(route_handler_arg);
41843 CHECK_ACCESS(route_handler_arg_ptr);
41844 LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr);
41845 if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
41846 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41847 LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv);
41849 void* onion_message_handler_arg_ptr = untag_ptr(onion_message_handler_arg);
41850 CHECK_ACCESS(onion_message_handler_arg_ptr);
41851 LDKOnionMessageHandler onion_message_handler_arg_conv = *(LDKOnionMessageHandler*)(onion_message_handler_arg_ptr);
41852 if (onion_message_handler_arg_conv.free == LDKOnionMessageHandler_JCalls_free) {
41853 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41854 LDKOnionMessageHandler_JCalls_cloned(&onion_message_handler_arg_conv);
41856 LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv, onion_message_handler_arg_conv);
41857 int64_t ret_ref = 0;
41858 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41859 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41863 static inline uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) {
41864 LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
41865 *ret_ret = SocketDescriptor_clone(arg);
41866 return tag_ptr(ret_ret, true);
41868 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
41869 void* arg_ptr = untag_ptr(arg);
41870 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
41871 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr;
41872 int64_t ret_conv = SocketDescriptor_clone_ptr(arg_conv);
41876 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1clone(JNIEnv *env, jclass clz, int64_t orig) {
41877 void* orig_ptr = untag_ptr(orig);
41878 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
41879 LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr;
41880 LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
41881 *ret_ret = SocketDescriptor_clone(orig_conv);
41882 return tag_ptr(ret_ret, true);
41885 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
41886 if (!ptr_is_owned(this_ptr)) return;
41887 void* this_ptr_ptr = untag_ptr(this_ptr);
41888 CHECK_ACCESS(this_ptr_ptr);
41889 LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr);
41890 FREE(untag_ptr(this_ptr));
41891 SocketDescriptor_free(this_ptr_conv);
41894 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41895 LDKPeerHandleError this_obj_conv;
41896 this_obj_conv.inner = untag_ptr(this_obj);
41897 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41898 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41899 PeerHandleError_free(this_obj_conv);
41902 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv *env, jclass clz) {
41903 LDKPeerHandleError ret_var = PeerHandleError_new();
41904 int64_t ret_ref = 0;
41905 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41906 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41910 static inline uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) {
41911 LDKPeerHandleError ret_var = PeerHandleError_clone(arg);
41912 int64_t ret_ref = 0;
41913 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41914 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41917 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
41918 LDKPeerHandleError arg_conv;
41919 arg_conv.inner = untag_ptr(arg);
41920 arg_conv.is_owned = ptr_is_owned(arg);
41921 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41922 arg_conv.is_owned = false;
41923 int64_t ret_conv = PeerHandleError_clone_ptr(&arg_conv);
41927 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
41928 LDKPeerHandleError orig_conv;
41929 orig_conv.inner = untag_ptr(orig);
41930 orig_conv.is_owned = ptr_is_owned(orig);
41931 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41932 orig_conv.is_owned = false;
41933 LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv);
41934 int64_t ret_ref = 0;
41935 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41936 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41940 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
41941 LDKPeerManager this_obj_conv;
41942 this_obj_conv.inner = untag_ptr(this_obj);
41943 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41944 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41945 PeerManager_free(this_obj_conv);
41948 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) {
41949 LDKMessageHandler message_handler_conv;
41950 message_handler_conv.inner = untag_ptr(message_handler);
41951 message_handler_conv.is_owned = ptr_is_owned(message_handler);
41952 CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv);
41953 // WARNING: we need a move here but no clone is available for LDKMessageHandler
41955 uint8_t ephemeral_random_data_arr[32];
41956 CHECK((*env)->GetArrayLength(env, ephemeral_random_data) == 32);
41957 (*env)->GetByteArrayRegion(env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr);
41958 uint8_t (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
41959 void* logger_ptr = untag_ptr(logger);
41960 CHECK_ACCESS(logger_ptr);
41961 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
41962 if (logger_conv.free == LDKLogger_JCalls_free) {
41963 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41964 LDKLogger_JCalls_cloned(&logger_conv);
41966 void* custom_message_handler_ptr = untag_ptr(custom_message_handler);
41967 CHECK_ACCESS(custom_message_handler_ptr);
41968 LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr);
41969 if (custom_message_handler_conv.free == LDKCustomMessageHandler_JCalls_free) {
41970 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41971 LDKCustomMessageHandler_JCalls_cloned(&custom_message_handler_conv);
41973 void* node_signer_ptr = untag_ptr(node_signer);
41974 CHECK_ACCESS(node_signer_ptr);
41975 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
41976 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
41977 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41978 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
41980 LDKPeerManager ret_var = PeerManager_new(message_handler_conv, current_time, ephemeral_random_data_ref, logger_conv, custom_message_handler_conv, node_signer_conv);
41981 int64_t ret_ref = 0;
41982 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41983 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41987 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv *env, jclass clz, int64_t this_arg) {
41988 LDKPeerManager this_arg_conv;
41989 this_arg_conv.inner = untag_ptr(this_arg);
41990 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41991 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41992 this_arg_conv.is_owned = false;
41993 LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv);
41994 int64_tArray ret_arr = NULL;
41995 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
41996 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
41997 for (size_t o = 0; o < ret_var.datalen; o++) {
41998 LDKC2Tuple_PublicKeyCOption_NetAddressZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_NetAddressZZ), "LDKC2Tuple_PublicKeyCOption_NetAddressZZ");
41999 *ret_conv_40_conv = ret_var.data[o];
42000 ret_arr_ptr[o] = tag_ptr(ret_conv_40_conv, true);
42002 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
42003 FREE(ret_var.data);
42007 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) {
42008 LDKPeerManager this_arg_conv;
42009 this_arg_conv.inner = untag_ptr(this_arg);
42010 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42011 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42012 this_arg_conv.is_owned = false;
42013 LDKPublicKey their_node_id_ref;
42014 CHECK((*env)->GetArrayLength(env, their_node_id) == 33);
42015 (*env)->GetByteArrayRegion(env, their_node_id, 0, 33, their_node_id_ref.compressed_form);
42016 void* descriptor_ptr = untag_ptr(descriptor);
42017 CHECK_ACCESS(descriptor_ptr);
42018 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
42019 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
42020 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
42021 LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
42023 void* remote_network_address_ptr = untag_ptr(remote_network_address);
42024 CHECK_ACCESS(remote_network_address_ptr);
42025 LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr);
42026 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
42027 *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv, remote_network_address_conv);
42028 return tag_ptr(ret_conv, true);
42031 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) {
42032 LDKPeerManager this_arg_conv;
42033 this_arg_conv.inner = untag_ptr(this_arg);
42034 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42035 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42036 this_arg_conv.is_owned = false;
42037 void* descriptor_ptr = untag_ptr(descriptor);
42038 CHECK_ACCESS(descriptor_ptr);
42039 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
42040 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
42041 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
42042 LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
42044 void* remote_network_address_ptr = untag_ptr(remote_network_address);
42045 CHECK_ACCESS(remote_network_address_ptr);
42046 LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr);
42047 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
42048 *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv, remote_network_address_conv);
42049 return tag_ptr(ret_conv, true);
42052 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) {
42053 LDKPeerManager this_arg_conv;
42054 this_arg_conv.inner = untag_ptr(this_arg);
42055 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42056 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42057 this_arg_conv.is_owned = false;
42058 void* descriptor_ptr = untag_ptr(descriptor);
42059 if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); }
42060 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
42061 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
42062 *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv);
42063 return tag_ptr(ret_conv, true);
42066 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) {
42067 LDKPeerManager this_arg_conv;
42068 this_arg_conv.inner = untag_ptr(this_arg);
42069 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42070 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42071 this_arg_conv.is_owned = false;
42072 void* peer_descriptor_ptr = untag_ptr(peer_descriptor);
42073 if (ptr_is_owned(peer_descriptor)) { CHECK_ACCESS(peer_descriptor_ptr); }
42074 LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr;
42075 LDKu8slice data_ref;
42076 data_ref.datalen = (*env)->GetArrayLength(env, data);
42077 data_ref.data = (*env)->GetByteArrayElements (env, data, NULL);
42078 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
42079 *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref);
42080 (*env)->ReleaseByteArrayElements(env, data, (int8_t*)data_ref.data, 0);
42081 return tag_ptr(ret_conv, true);
42084 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
42085 LDKPeerManager this_arg_conv;
42086 this_arg_conv.inner = untag_ptr(this_arg);
42087 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42088 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42089 this_arg_conv.is_owned = false;
42090 PeerManager_process_events(&this_arg_conv);
42093 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int64_t descriptor) {
42094 LDKPeerManager this_arg_conv;
42095 this_arg_conv.inner = untag_ptr(this_arg);
42096 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42097 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42098 this_arg_conv.is_owned = false;
42099 void* descriptor_ptr = untag_ptr(descriptor);
42100 if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); }
42101 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
42102 PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv);
42105 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) {
42106 LDKPeerManager this_arg_conv;
42107 this_arg_conv.inner = untag_ptr(this_arg);
42108 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42109 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42110 this_arg_conv.is_owned = false;
42111 LDKPublicKey node_id_ref;
42112 CHECK((*env)->GetArrayLength(env, node_id) == 33);
42113 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
42114 PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref);
42117 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1disconnect_1all_1peers(JNIEnv *env, jclass clz, int64_t this_arg) {
42118 LDKPeerManager this_arg_conv;
42119 this_arg_conv.inner = untag_ptr(this_arg);
42120 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42121 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42122 this_arg_conv.is_owned = false;
42123 PeerManager_disconnect_all_peers(&this_arg_conv);
42126 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occurred(JNIEnv *env, jclass clz, int64_t this_arg) {
42127 LDKPeerManager this_arg_conv;
42128 this_arg_conv.inner = untag_ptr(this_arg);
42129 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42130 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42131 this_arg_conv.is_owned = false;
42132 PeerManager_timer_tick_occurred(&this_arg_conv);
42135 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) {
42136 LDKPeerManager this_arg_conv;
42137 this_arg_conv.inner = untag_ptr(this_arg);
42138 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42139 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42140 this_arg_conv.is_owned = false;
42141 LDKThreeBytes rgb_ref;
42142 CHECK((*env)->GetArrayLength(env, rgb) == 3);
42143 (*env)->GetByteArrayRegion(env, rgb, 0, 3, rgb_ref.data);
42144 LDKThirtyTwoBytes alias_ref;
42145 CHECK((*env)->GetArrayLength(env, alias) == 32);
42146 (*env)->GetByteArrayRegion(env, alias, 0, 32, alias_ref.data);
42147 LDKCVec_NetAddressZ addresses_constr;
42148 addresses_constr.datalen = (*env)->GetArrayLength(env, addresses);
42149 if (addresses_constr.datalen > 0)
42150 addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
42152 addresses_constr.data = NULL;
42153 int64_t* addresses_vals = (*env)->GetLongArrayElements (env, addresses, NULL);
42154 for (size_t m = 0; m < addresses_constr.datalen; m++) {
42155 int64_t addresses_conv_12 = addresses_vals[m];
42156 void* addresses_conv_12_ptr = untag_ptr(addresses_conv_12);
42157 CHECK_ACCESS(addresses_conv_12_ptr);
42158 LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr);
42159 addresses_constr.data[m] = addresses_conv_12_conv;
42161 (*env)->ReleaseLongArrayElements(env, addresses, addresses_vals, 0);
42162 PeerManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr);
42165 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1success_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) {
42166 int64_t ret_conv = htlc_success_tx_weight(opt_anchors);
42170 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1timeout_1tx_1weight(JNIEnv *env, jclass clz, jboolean opt_anchors) {
42171 int64_t ret_conv = htlc_timeout_tx_weight(opt_anchors);
42175 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42176 LDKHTLCClaim* orig_conv = (LDKHTLCClaim*)untag_ptr(orig);
42177 jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_clone(orig_conv));
42181 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1offered_1timeout(JNIEnv *env, jclass clz) {
42182 jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_offered_timeout());
42186 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1offered_1preimage(JNIEnv *env, jclass clz) {
42187 jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_offered_preimage());
42191 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1accepted_1timeout(JNIEnv *env, jclass clz) {
42192 jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_accepted_timeout());
42196 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1accepted_1preimage(JNIEnv *env, jclass clz) {
42197 jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_accepted_preimage());
42201 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1revocation(JNIEnv *env, jclass clz) {
42202 jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_revocation());
42206 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
42207 LDKHTLCClaim* a_conv = (LDKHTLCClaim*)untag_ptr(a);
42208 LDKHTLCClaim* b_conv = (LDKHTLCClaim*)untag_ptr(b);
42209 jboolean ret_conv = HTLCClaim_eq(a_conv, b_conv);
42213 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1from_1witness(JNIEnv *env, jclass clz, int8_tArray witness) {
42214 LDKWitness witness_ref;
42215 witness_ref.datalen = (*env)->GetArrayLength(env, witness);
42216 witness_ref.data = MALLOC(witness_ref.datalen, "LDKWitness Bytes");
42217 (*env)->GetByteArrayRegion(env, witness, 0, witness_ref.datalen, witness_ref.data);
42218 witness_ref.data_is_owned = true;
42219 LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ");
42220 *ret_copy = HTLCClaim_from_witness(witness_ref);
42221 int64_t ret_ref = tag_ptr(ret_copy, true);
42225 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv *env, jclass clz, int8_tArray commitment_seed, int64_t idx) {
42226 uint8_t commitment_seed_arr[32];
42227 CHECK((*env)->GetArrayLength(env, commitment_seed) == 32);
42228 (*env)->GetByteArrayRegion(env, commitment_seed, 0, 32, commitment_seed_arr);
42229 uint8_t (*commitment_seed_ref)[32] = &commitment_seed_arr;
42230 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
42231 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, build_commitment_secret(commitment_seed_ref, idx).data);
42235 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) {
42236 LDKCVec_u8Z to_holder_script_ref;
42237 to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script);
42238 to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes");
42239 (*env)->GetByteArrayRegion(env, to_holder_script, 0, to_holder_script_ref.datalen, to_holder_script_ref.data);
42240 LDKCVec_u8Z to_counterparty_script_ref;
42241 to_counterparty_script_ref.datalen = (*env)->GetArrayLength(env, to_counterparty_script);
42242 to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes");
42243 (*env)->GetByteArrayRegion(env, to_counterparty_script, 0, to_counterparty_script_ref.datalen, to_counterparty_script_ref.data);
42244 LDKOutPoint funding_outpoint_conv;
42245 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
42246 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
42247 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
42248 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
42249 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);
42250 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42251 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42252 Transaction_free(ret_var);
42256 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42257 LDKCounterpartyCommitmentSecrets this_obj_conv;
42258 this_obj_conv.inner = untag_ptr(this_obj);
42259 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42260 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42261 CounterpartyCommitmentSecrets_free(this_obj_conv);
42264 static inline uint64_t CounterpartyCommitmentSecrets_clone_ptr(LDKCounterpartyCommitmentSecrets *NONNULL_PTR arg) {
42265 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(arg);
42266 int64_t ret_ref = 0;
42267 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42268 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42271 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
42272 LDKCounterpartyCommitmentSecrets arg_conv;
42273 arg_conv.inner = untag_ptr(arg);
42274 arg_conv.is_owned = ptr_is_owned(arg);
42275 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42276 arg_conv.is_owned = false;
42277 int64_t ret_conv = CounterpartyCommitmentSecrets_clone_ptr(&arg_conv);
42281 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42282 LDKCounterpartyCommitmentSecrets orig_conv;
42283 orig_conv.inner = untag_ptr(orig);
42284 orig_conv.is_owned = ptr_is_owned(orig);
42285 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42286 orig_conv.is_owned = false;
42287 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(&orig_conv);
42288 int64_t ret_ref = 0;
42289 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42290 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42294 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1new(JNIEnv *env, jclass clz) {
42295 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_new();
42296 int64_t ret_ref = 0;
42297 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42298 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42302 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1get_1min_1seen_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
42303 LDKCounterpartyCommitmentSecrets this_arg_conv;
42304 this_arg_conv.inner = untag_ptr(this_arg);
42305 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42306 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42307 this_arg_conv.is_owned = false;
42308 int64_t ret_conv = CounterpartyCommitmentSecrets_get_min_seen_secret(&this_arg_conv);
42312 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) {
42313 LDKCounterpartyCommitmentSecrets this_arg_conv;
42314 this_arg_conv.inner = untag_ptr(this_arg);
42315 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42316 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42317 this_arg_conv.is_owned = false;
42318 LDKThirtyTwoBytes secret_ref;
42319 CHECK((*env)->GetArrayLength(env, secret) == 32);
42320 (*env)->GetByteArrayRegion(env, secret, 0, 32, secret_ref.data);
42321 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
42322 *ret_conv = CounterpartyCommitmentSecrets_provide_secret(&this_arg_conv, idx, secret_ref);
42323 return tag_ptr(ret_conv, true);
42326 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1get_1secret(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) {
42327 LDKCounterpartyCommitmentSecrets this_arg_conv;
42328 this_arg_conv.inner = untag_ptr(this_arg);
42329 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42330 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42331 this_arg_conv.is_owned = false;
42332 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
42333 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CounterpartyCommitmentSecrets_get_secret(&this_arg_conv, idx).data);
42337 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1write(JNIEnv *env, jclass clz, int64_t obj) {
42338 LDKCounterpartyCommitmentSecrets obj_conv;
42339 obj_conv.inner = untag_ptr(obj);
42340 obj_conv.is_owned = ptr_is_owned(obj);
42341 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42342 obj_conv.is_owned = false;
42343 LDKCVec_u8Z ret_var = CounterpartyCommitmentSecrets_write(&obj_conv);
42344 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42345 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42346 CVec_u8Z_free(ret_var);
42350 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
42351 LDKu8slice ser_ref;
42352 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
42353 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
42354 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
42355 *ret_conv = CounterpartyCommitmentSecrets_read(ser_ref);
42356 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
42357 return tag_ptr(ret_conv, true);
42360 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) {
42361 LDKPublicKey per_commitment_point_ref;
42362 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
42363 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
42364 uint8_t base_secret_arr[32];
42365 CHECK((*env)->GetArrayLength(env, base_secret) == 32);
42366 (*env)->GetByteArrayRegion(env, base_secret, 0, 32, base_secret_arr);
42367 uint8_t (*base_secret_ref)[32] = &base_secret_arr;
42368 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
42369 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, derive_private_key(per_commitment_point_ref, base_secret_ref).bytes);
42373 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) {
42374 LDKPublicKey per_commitment_point_ref;
42375 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
42376 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
42377 LDKPublicKey base_point_ref;
42378 CHECK((*env)->GetArrayLength(env, base_point) == 33);
42379 (*env)->GetByteArrayRegion(env, base_point, 0, 33, base_point_ref.compressed_form);
42380 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42381 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, derive_public_key(per_commitment_point_ref, base_point_ref).compressed_form);
42385 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) {
42386 uint8_t per_commitment_secret_arr[32];
42387 CHECK((*env)->GetArrayLength(env, per_commitment_secret) == 32);
42388 (*env)->GetByteArrayRegion(env, per_commitment_secret, 0, 32, per_commitment_secret_arr);
42389 uint8_t (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr;
42390 uint8_t countersignatory_revocation_base_secret_arr[32];
42391 CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base_secret) == 32);
42392 (*env)->GetByteArrayRegion(env, countersignatory_revocation_base_secret, 0, 32, countersignatory_revocation_base_secret_arr);
42393 uint8_t (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr;
42394 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
42395 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref).bytes);
42399 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) {
42400 LDKPublicKey per_commitment_point_ref;
42401 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
42402 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
42403 LDKPublicKey countersignatory_revocation_base_point_ref;
42404 CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base_point) == 33);
42405 (*env)->GetByteArrayRegion(env, countersignatory_revocation_base_point, 0, 33, countersignatory_revocation_base_point_ref.compressed_form);
42406 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42407 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref).compressed_form);
42411 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42412 LDKTxCreationKeys this_obj_conv;
42413 this_obj_conv.inner = untag_ptr(this_obj);
42414 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42415 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42416 TxCreationKeys_free(this_obj_conv);
42419 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
42420 LDKTxCreationKeys this_ptr_conv;
42421 this_ptr_conv.inner = untag_ptr(this_ptr);
42422 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42423 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42424 this_ptr_conv.is_owned = false;
42425 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42426 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form);
42430 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42431 LDKTxCreationKeys this_ptr_conv;
42432 this_ptr_conv.inner = untag_ptr(this_ptr);
42433 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42434 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42435 this_ptr_conv.is_owned = false;
42436 LDKPublicKey val_ref;
42437 CHECK((*env)->GetArrayLength(env, val) == 33);
42438 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42439 TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref);
42442 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
42443 LDKTxCreationKeys this_ptr_conv;
42444 this_ptr_conv.inner = untag_ptr(this_ptr);
42445 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42446 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42447 this_ptr_conv.is_owned = false;
42448 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42449 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form);
42453 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42454 LDKTxCreationKeys this_ptr_conv;
42455 this_ptr_conv.inner = untag_ptr(this_ptr);
42456 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42457 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42458 this_ptr_conv.is_owned = false;
42459 LDKPublicKey val_ref;
42460 CHECK((*env)->GetArrayLength(env, val) == 33);
42461 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42462 TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref);
42465 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
42466 LDKTxCreationKeys this_ptr_conv;
42467 this_ptr_conv.inner = untag_ptr(this_ptr);
42468 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42469 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42470 this_ptr_conv.is_owned = false;
42471 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42472 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form);
42476 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42477 LDKTxCreationKeys this_ptr_conv;
42478 this_ptr_conv.inner = untag_ptr(this_ptr);
42479 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42480 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42481 this_ptr_conv.is_owned = false;
42482 LDKPublicKey val_ref;
42483 CHECK((*env)->GetArrayLength(env, val) == 33);
42484 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42485 TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref);
42488 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
42489 LDKTxCreationKeys this_ptr_conv;
42490 this_ptr_conv.inner = untag_ptr(this_ptr);
42491 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42492 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42493 this_ptr_conv.is_owned = false;
42494 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42495 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form);
42499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42500 LDKTxCreationKeys this_ptr_conv;
42501 this_ptr_conv.inner = untag_ptr(this_ptr);
42502 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42503 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42504 this_ptr_conv.is_owned = false;
42505 LDKPublicKey val_ref;
42506 CHECK((*env)->GetArrayLength(env, val) == 33);
42507 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42508 TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref);
42511 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key(JNIEnv *env, jclass clz, int64_t this_ptr) {
42512 LDKTxCreationKeys this_ptr_conv;
42513 this_ptr_conv.inner = untag_ptr(this_ptr);
42514 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42515 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42516 this_ptr_conv.is_owned = false;
42517 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42518 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form);
42522 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) {
42523 LDKTxCreationKeys this_ptr_conv;
42524 this_ptr_conv.inner = untag_ptr(this_ptr);
42525 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42526 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42527 this_ptr_conv.is_owned = false;
42528 LDKPublicKey val_ref;
42529 CHECK((*env)->GetArrayLength(env, val) == 33);
42530 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42531 TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref);
42534 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) {
42535 LDKPublicKey per_commitment_point_arg_ref;
42536 CHECK((*env)->GetArrayLength(env, per_commitment_point_arg) == 33);
42537 (*env)->GetByteArrayRegion(env, per_commitment_point_arg, 0, 33, per_commitment_point_arg_ref.compressed_form);
42538 LDKPublicKey revocation_key_arg_ref;
42539 CHECK((*env)->GetArrayLength(env, revocation_key_arg) == 33);
42540 (*env)->GetByteArrayRegion(env, revocation_key_arg, 0, 33, revocation_key_arg_ref.compressed_form);
42541 LDKPublicKey broadcaster_htlc_key_arg_ref;
42542 CHECK((*env)->GetArrayLength(env, broadcaster_htlc_key_arg) == 33);
42543 (*env)->GetByteArrayRegion(env, broadcaster_htlc_key_arg, 0, 33, broadcaster_htlc_key_arg_ref.compressed_form);
42544 LDKPublicKey countersignatory_htlc_key_arg_ref;
42545 CHECK((*env)->GetArrayLength(env, countersignatory_htlc_key_arg) == 33);
42546 (*env)->GetByteArrayRegion(env, countersignatory_htlc_key_arg, 0, 33, countersignatory_htlc_key_arg_ref.compressed_form);
42547 LDKPublicKey broadcaster_delayed_payment_key_arg_ref;
42548 CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key_arg) == 33);
42549 (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key_arg, 0, 33, broadcaster_delayed_payment_key_arg_ref.compressed_form);
42550 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);
42551 int64_t ret_ref = 0;
42552 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42553 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42557 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
42558 LDKTxCreationKeys a_conv;
42559 a_conv.inner = untag_ptr(a);
42560 a_conv.is_owned = ptr_is_owned(a);
42561 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42562 a_conv.is_owned = false;
42563 LDKTxCreationKeys b_conv;
42564 b_conv.inner = untag_ptr(b);
42565 b_conv.is_owned = ptr_is_owned(b);
42566 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42567 b_conv.is_owned = false;
42568 jboolean ret_conv = TxCreationKeys_eq(&a_conv, &b_conv);
42572 static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) {
42573 LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg);
42574 int64_t ret_ref = 0;
42575 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42576 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42579 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
42580 LDKTxCreationKeys arg_conv;
42581 arg_conv.inner = untag_ptr(arg);
42582 arg_conv.is_owned = ptr_is_owned(arg);
42583 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42584 arg_conv.is_owned = false;
42585 int64_t ret_conv = TxCreationKeys_clone_ptr(&arg_conv);
42589 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42590 LDKTxCreationKeys orig_conv;
42591 orig_conv.inner = untag_ptr(orig);
42592 orig_conv.is_owned = ptr_is_owned(orig);
42593 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42594 orig_conv.is_owned = false;
42595 LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv);
42596 int64_t ret_ref = 0;
42597 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42598 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42602 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv *env, jclass clz, int64_t obj) {
42603 LDKTxCreationKeys obj_conv;
42604 obj_conv.inner = untag_ptr(obj);
42605 obj_conv.is_owned = ptr_is_owned(obj);
42606 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42607 obj_conv.is_owned = false;
42608 LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv);
42609 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42610 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42611 CVec_u8Z_free(ret_var);
42615 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
42616 LDKu8slice ser_ref;
42617 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
42618 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
42619 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
42620 *ret_conv = TxCreationKeys_read(ser_ref);
42621 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
42622 return tag_ptr(ret_conv, true);
42625 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42626 LDKChannelPublicKeys this_obj_conv;
42627 this_obj_conv.inner = untag_ptr(this_obj);
42628 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42629 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42630 ChannelPublicKeys_free(this_obj_conv);
42633 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
42634 LDKChannelPublicKeys this_ptr_conv;
42635 this_ptr_conv.inner = untag_ptr(this_ptr);
42636 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42637 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42638 this_ptr_conv.is_owned = false;
42639 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42640 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form);
42644 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42645 LDKChannelPublicKeys this_ptr_conv;
42646 this_ptr_conv.inner = untag_ptr(this_ptr);
42647 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42648 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42649 this_ptr_conv.is_owned = false;
42650 LDKPublicKey val_ref;
42651 CHECK((*env)->GetArrayLength(env, val) == 33);
42652 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42653 ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref);
42656 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
42657 LDKChannelPublicKeys this_ptr_conv;
42658 this_ptr_conv.inner = untag_ptr(this_ptr);
42659 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42660 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42661 this_ptr_conv.is_owned = false;
42662 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42663 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form);
42667 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42668 LDKChannelPublicKeys this_ptr_conv;
42669 this_ptr_conv.inner = untag_ptr(this_ptr);
42670 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42671 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42672 this_ptr_conv.is_owned = false;
42673 LDKPublicKey val_ref;
42674 CHECK((*env)->GetArrayLength(env, val) == 33);
42675 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42676 ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref);
42679 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
42680 LDKChannelPublicKeys this_ptr_conv;
42681 this_ptr_conv.inner = untag_ptr(this_ptr);
42682 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42683 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42684 this_ptr_conv.is_owned = false;
42685 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42686 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form);
42690 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42691 LDKChannelPublicKeys this_ptr_conv;
42692 this_ptr_conv.inner = untag_ptr(this_ptr);
42693 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42694 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42695 this_ptr_conv.is_owned = false;
42696 LDKPublicKey val_ref;
42697 CHECK((*env)->GetArrayLength(env, val) == 33);
42698 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42699 ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref);
42702 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
42703 LDKChannelPublicKeys this_ptr_conv;
42704 this_ptr_conv.inner = untag_ptr(this_ptr);
42705 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42706 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42707 this_ptr_conv.is_owned = false;
42708 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42709 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form);
42713 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42714 LDKChannelPublicKeys this_ptr_conv;
42715 this_ptr_conv.inner = untag_ptr(this_ptr);
42716 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42717 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42718 this_ptr_conv.is_owned = false;
42719 LDKPublicKey val_ref;
42720 CHECK((*env)->GetArrayLength(env, val) == 33);
42721 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42722 ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
42725 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
42726 LDKChannelPublicKeys this_ptr_conv;
42727 this_ptr_conv.inner = untag_ptr(this_ptr);
42728 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42729 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42730 this_ptr_conv.is_owned = false;
42731 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
42732 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form);
42736 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42737 LDKChannelPublicKeys this_ptr_conv;
42738 this_ptr_conv.inner = untag_ptr(this_ptr);
42739 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42740 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42741 this_ptr_conv.is_owned = false;
42742 LDKPublicKey val_ref;
42743 CHECK((*env)->GetArrayLength(env, val) == 33);
42744 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
42745 ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref);
42748 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) {
42749 LDKPublicKey funding_pubkey_arg_ref;
42750 CHECK((*env)->GetArrayLength(env, funding_pubkey_arg) == 33);
42751 (*env)->GetByteArrayRegion(env, funding_pubkey_arg, 0, 33, funding_pubkey_arg_ref.compressed_form);
42752 LDKPublicKey revocation_basepoint_arg_ref;
42753 CHECK((*env)->GetArrayLength(env, revocation_basepoint_arg) == 33);
42754 (*env)->GetByteArrayRegion(env, revocation_basepoint_arg, 0, 33, revocation_basepoint_arg_ref.compressed_form);
42755 LDKPublicKey payment_point_arg_ref;
42756 CHECK((*env)->GetArrayLength(env, payment_point_arg) == 33);
42757 (*env)->GetByteArrayRegion(env, payment_point_arg, 0, 33, payment_point_arg_ref.compressed_form);
42758 LDKPublicKey delayed_payment_basepoint_arg_ref;
42759 CHECK((*env)->GetArrayLength(env, delayed_payment_basepoint_arg) == 33);
42760 (*env)->GetByteArrayRegion(env, delayed_payment_basepoint_arg, 0, 33, delayed_payment_basepoint_arg_ref.compressed_form);
42761 LDKPublicKey htlc_basepoint_arg_ref;
42762 CHECK((*env)->GetArrayLength(env, htlc_basepoint_arg) == 33);
42763 (*env)->GetByteArrayRegion(env, htlc_basepoint_arg, 0, 33, htlc_basepoint_arg_ref.compressed_form);
42764 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);
42765 int64_t ret_ref = 0;
42766 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42767 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42771 static inline uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) {
42772 LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg);
42773 int64_t ret_ref = 0;
42774 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42775 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42778 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
42779 LDKChannelPublicKeys arg_conv;
42780 arg_conv.inner = untag_ptr(arg);
42781 arg_conv.is_owned = ptr_is_owned(arg);
42782 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42783 arg_conv.is_owned = false;
42784 int64_t ret_conv = ChannelPublicKeys_clone_ptr(&arg_conv);
42788 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone(JNIEnv *env, jclass clz, int64_t orig) {
42789 LDKChannelPublicKeys orig_conv;
42790 orig_conv.inner = untag_ptr(orig);
42791 orig_conv.is_owned = ptr_is_owned(orig);
42792 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42793 orig_conv.is_owned = false;
42794 LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv);
42795 int64_t ret_ref = 0;
42796 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42797 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42801 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
42802 LDKChannelPublicKeys a_conv;
42803 a_conv.inner = untag_ptr(a);
42804 a_conv.is_owned = ptr_is_owned(a);
42805 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42806 a_conv.is_owned = false;
42807 LDKChannelPublicKeys b_conv;
42808 b_conv.inner = untag_ptr(b);
42809 b_conv.is_owned = ptr_is_owned(b);
42810 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42811 b_conv.is_owned = false;
42812 jboolean ret_conv = ChannelPublicKeys_eq(&a_conv, &b_conv);
42816 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv *env, jclass clz, int64_t obj) {
42817 LDKChannelPublicKeys obj_conv;
42818 obj_conv.inner = untag_ptr(obj);
42819 obj_conv.is_owned = ptr_is_owned(obj);
42820 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
42821 obj_conv.is_owned = false;
42822 LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv);
42823 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42824 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42825 CVec_u8Z_free(ret_var);
42829 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
42830 LDKu8slice ser_ref;
42831 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
42832 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
42833 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
42834 *ret_conv = ChannelPublicKeys_read(ser_ref);
42835 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
42836 return tag_ptr(ret_conv, true);
42839 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) {
42840 LDKPublicKey per_commitment_point_ref;
42841 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
42842 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
42843 LDKPublicKey broadcaster_delayed_payment_base_ref;
42844 CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_base) == 33);
42845 (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_base, 0, 33, broadcaster_delayed_payment_base_ref.compressed_form);
42846 LDKPublicKey broadcaster_htlc_base_ref;
42847 CHECK((*env)->GetArrayLength(env, broadcaster_htlc_base) == 33);
42848 (*env)->GetByteArrayRegion(env, broadcaster_htlc_base, 0, 33, broadcaster_htlc_base_ref.compressed_form);
42849 LDKPublicKey countersignatory_revocation_base_ref;
42850 CHECK((*env)->GetArrayLength(env, countersignatory_revocation_base) == 33);
42851 (*env)->GetByteArrayRegion(env, countersignatory_revocation_base, 0, 33, countersignatory_revocation_base_ref.compressed_form);
42852 LDKPublicKey countersignatory_htlc_base_ref;
42853 CHECK((*env)->GetArrayLength(env, countersignatory_htlc_base) == 33);
42854 (*env)->GetByteArrayRegion(env, countersignatory_htlc_base, 0, 33, countersignatory_htlc_base_ref.compressed_form);
42855 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);
42856 int64_t ret_ref = 0;
42857 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42858 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42862 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) {
42863 LDKPublicKey per_commitment_point_ref;
42864 CHECK((*env)->GetArrayLength(env, per_commitment_point) == 33);
42865 (*env)->GetByteArrayRegion(env, per_commitment_point, 0, 33, per_commitment_point_ref.compressed_form);
42866 LDKChannelPublicKeys broadcaster_keys_conv;
42867 broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys);
42868 broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys);
42869 CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
42870 broadcaster_keys_conv.is_owned = false;
42871 LDKChannelPublicKeys countersignatory_keys_conv;
42872 countersignatory_keys_conv.inner = untag_ptr(countersignatory_keys);
42873 countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys);
42874 CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
42875 countersignatory_keys_conv.is_owned = false;
42876 LDKTxCreationKeys ret_var = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv);
42877 int64_t ret_ref = 0;
42878 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42879 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42883 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) {
42884 LDKPublicKey revocation_key_ref;
42885 CHECK((*env)->GetArrayLength(env, revocation_key) == 33);
42886 (*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form);
42887 LDKPublicKey broadcaster_delayed_payment_key_ref;
42888 CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33);
42889 (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form);
42890 LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref);
42891 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
42892 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
42893 CVec_u8Z_free(ret_var);
42897 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
42898 LDKHTLCOutputInCommitment this_obj_conv;
42899 this_obj_conv.inner = untag_ptr(this_obj);
42900 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42901 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42902 HTLCOutputInCommitment_free(this_obj_conv);
42905 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv *env, jclass clz, int64_t this_ptr) {
42906 LDKHTLCOutputInCommitment this_ptr_conv;
42907 this_ptr_conv.inner = untag_ptr(this_ptr);
42908 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42909 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42910 this_ptr_conv.is_owned = false;
42911 jboolean ret_conv = HTLCOutputInCommitment_get_offered(&this_ptr_conv);
42915 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
42916 LDKHTLCOutputInCommitment this_ptr_conv;
42917 this_ptr_conv.inner = untag_ptr(this_ptr);
42918 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42919 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42920 this_ptr_conv.is_owned = false;
42921 HTLCOutputInCommitment_set_offered(&this_ptr_conv, val);
42924 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
42925 LDKHTLCOutputInCommitment this_ptr_conv;
42926 this_ptr_conv.inner = untag_ptr(this_ptr);
42927 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42928 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42929 this_ptr_conv.is_owned = false;
42930 int64_t ret_conv = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv);
42934 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
42935 LDKHTLCOutputInCommitment this_ptr_conv;
42936 this_ptr_conv.inner = untag_ptr(this_ptr);
42937 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42938 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42939 this_ptr_conv.is_owned = false;
42940 HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val);
42943 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr) {
42944 LDKHTLCOutputInCommitment this_ptr_conv;
42945 this_ptr_conv.inner = untag_ptr(this_ptr);
42946 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42947 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42948 this_ptr_conv.is_owned = false;
42949 int32_t ret_conv = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv);
42953 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
42954 LDKHTLCOutputInCommitment this_ptr_conv;
42955 this_ptr_conv.inner = untag_ptr(this_ptr);
42956 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42957 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42958 this_ptr_conv.is_owned = false;
42959 HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val);
42962 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr) {
42963 LDKHTLCOutputInCommitment this_ptr_conv;
42964 this_ptr_conv.inner = untag_ptr(this_ptr);
42965 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42966 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42967 this_ptr_conv.is_owned = false;
42968 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
42969 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv));
42973 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
42974 LDKHTLCOutputInCommitment this_ptr_conv;
42975 this_ptr_conv.inner = untag_ptr(this_ptr);
42976 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42977 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42978 this_ptr_conv.is_owned = false;
42979 LDKThirtyTwoBytes val_ref;
42980 CHECK((*env)->GetArrayLength(env, val) == 32);
42981 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
42982 HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref);
42985 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1transaction_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr) {
42986 LDKHTLCOutputInCommitment this_ptr_conv;
42987 this_ptr_conv.inner = untag_ptr(this_ptr);
42988 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42989 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42990 this_ptr_conv.is_owned = false;
42991 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
42992 *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv);
42993 int64_t ret_ref = tag_ptr(ret_copy, true);
42997 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1transaction_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
42998 LDKHTLCOutputInCommitment this_ptr_conv;
42999 this_ptr_conv.inner = untag_ptr(this_ptr);
43000 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43001 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43002 this_ptr_conv.is_owned = false;
43003 void* val_ptr = untag_ptr(val);
43004 CHECK_ACCESS(val_ptr);
43005 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
43006 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
43007 HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv);
43010 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) {
43011 LDKThirtyTwoBytes payment_hash_arg_ref;
43012 CHECK((*env)->GetArrayLength(env, payment_hash_arg) == 32);
43013 (*env)->GetByteArrayRegion(env, payment_hash_arg, 0, 32, payment_hash_arg_ref.data);
43014 void* transaction_output_index_arg_ptr = untag_ptr(transaction_output_index_arg);
43015 CHECK_ACCESS(transaction_output_index_arg_ptr);
43016 LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr);
43017 transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(transaction_output_index_arg));
43018 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv);
43019 int64_t ret_ref = 0;
43020 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43021 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43025 static inline uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) {
43026 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg);
43027 int64_t ret_ref = 0;
43028 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43029 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43032 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
43033 LDKHTLCOutputInCommitment arg_conv;
43034 arg_conv.inner = untag_ptr(arg);
43035 arg_conv.is_owned = ptr_is_owned(arg);
43036 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43037 arg_conv.is_owned = false;
43038 int64_t ret_conv = HTLCOutputInCommitment_clone_ptr(&arg_conv);
43042 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone(JNIEnv *env, jclass clz, int64_t orig) {
43043 LDKHTLCOutputInCommitment orig_conv;
43044 orig_conv.inner = untag_ptr(orig);
43045 orig_conv.is_owned = ptr_is_owned(orig);
43046 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43047 orig_conv.is_owned = false;
43048 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv);
43049 int64_t ret_ref = 0;
43050 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43051 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43055 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
43056 LDKHTLCOutputInCommitment a_conv;
43057 a_conv.inner = untag_ptr(a);
43058 a_conv.is_owned = ptr_is_owned(a);
43059 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
43060 a_conv.is_owned = false;
43061 LDKHTLCOutputInCommitment b_conv;
43062 b_conv.inner = untag_ptr(b);
43063 b_conv.is_owned = ptr_is_owned(b);
43064 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
43065 b_conv.is_owned = false;
43066 jboolean ret_conv = HTLCOutputInCommitment_eq(&a_conv, &b_conv);
43070 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv *env, jclass clz, int64_t obj) {
43071 LDKHTLCOutputInCommitment obj_conv;
43072 obj_conv.inner = untag_ptr(obj);
43073 obj_conv.is_owned = ptr_is_owned(obj);
43074 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43075 obj_conv.is_owned = false;
43076 LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv);
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 CVec_u8Z_free(ret_var);
43083 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
43084 LDKu8slice ser_ref;
43085 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
43086 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
43087 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
43088 *ret_conv = HTLCOutputInCommitment_read(ser_ref);
43089 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
43090 return tag_ptr(ret_conv, true);
43093 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) {
43094 LDKHTLCOutputInCommitment htlc_conv;
43095 htlc_conv.inner = untag_ptr(htlc);
43096 htlc_conv.is_owned = ptr_is_owned(htlc);
43097 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
43098 htlc_conv.is_owned = false;
43099 LDKTxCreationKeys keys_conv;
43100 keys_conv.inner = untag_ptr(keys);
43101 keys_conv.is_owned = ptr_is_owned(keys);
43102 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
43103 keys_conv.is_owned = false;
43104 LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_conv);
43105 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43106 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43107 CVec_u8Z_free(ret_var);
43111 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv *env, jclass clz, int8_tArray broadcaster, int8_tArray countersignatory) {
43112 LDKPublicKey broadcaster_ref;
43113 CHECK((*env)->GetArrayLength(env, broadcaster) == 33);
43114 (*env)->GetByteArrayRegion(env, broadcaster, 0, 33, broadcaster_ref.compressed_form);
43115 LDKPublicKey countersignatory_ref;
43116 CHECK((*env)->GetArrayLength(env, countersignatory) == 33);
43117 (*env)->GetByteArrayRegion(env, countersignatory, 0, 33, countersignatory_ref.compressed_form);
43118 LDKCVec_u8Z ret_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref);
43119 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43120 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43121 CVec_u8Z_free(ret_var);
43125 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) {
43126 uint8_t commitment_txid_arr[32];
43127 CHECK((*env)->GetArrayLength(env, commitment_txid) == 32);
43128 (*env)->GetByteArrayRegion(env, commitment_txid, 0, 32, commitment_txid_arr);
43129 uint8_t (*commitment_txid_ref)[32] = &commitment_txid_arr;
43130 LDKHTLCOutputInCommitment htlc_conv;
43131 htlc_conv.inner = untag_ptr(htlc);
43132 htlc_conv.is_owned = ptr_is_owned(htlc);
43133 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
43134 htlc_conv.is_owned = false;
43135 LDKPublicKey broadcaster_delayed_payment_key_ref;
43136 CHECK((*env)->GetArrayLength(env, broadcaster_delayed_payment_key) == 33);
43137 (*env)->GetByteArrayRegion(env, broadcaster_delayed_payment_key, 0, 33, broadcaster_delayed_payment_key_ref.compressed_form);
43138 LDKPublicKey revocation_key_ref;
43139 CHECK((*env)->GetArrayLength(env, revocation_key) == 33);
43140 (*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form);
43141 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);
43142 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43143 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43144 Transaction_free(ret_var);
43148 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) {
43149 LDKSignature local_sig_ref;
43150 CHECK((*env)->GetArrayLength(env, local_sig) == 64);
43151 (*env)->GetByteArrayRegion(env, local_sig, 0, 64, local_sig_ref.compact_form);
43152 LDKSignature remote_sig_ref;
43153 CHECK((*env)->GetArrayLength(env, remote_sig) == 64);
43154 (*env)->GetByteArrayRegion(env, remote_sig, 0, 64, remote_sig_ref.compact_form);
43155 LDKThirtyTwoBytes preimage_ref;
43156 CHECK((*env)->GetArrayLength(env, preimage) == 32);
43157 (*env)->GetByteArrayRegion(env, preimage, 0, 32, preimage_ref.data);
43158 LDKu8slice redeem_script_ref;
43159 redeem_script_ref.datalen = (*env)->GetArrayLength(env, redeem_script);
43160 redeem_script_ref.data = (*env)->GetByteArrayElements (env, redeem_script, NULL);
43161 LDKWitness ret_var = build_htlc_input_witness(local_sig_ref, remote_sig_ref, preimage_ref, redeem_script_ref, opt_anchors);
43162 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43163 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43164 Witness_free(ret_var);
43165 (*env)->ReleaseByteArrayElements(env, redeem_script, (int8_t*)redeem_script_ref.data, 0);
43169 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1to_1countersignatory_1with_1anchors_1redeemscript(JNIEnv *env, jclass clz, int8_tArray payment_point) {
43170 LDKPublicKey payment_point_ref;
43171 CHECK((*env)->GetArrayLength(env, payment_point) == 33);
43172 (*env)->GetByteArrayRegion(env, payment_point, 0, 33, payment_point_ref.compressed_form);
43173 LDKCVec_u8Z ret_var = get_to_countersignatory_with_anchors_redeemscript(payment_point_ref);
43174 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43175 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43176 CVec_u8Z_free(ret_var);
43180 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1anchor_1redeemscript(JNIEnv *env, jclass clz, int8_tArray funding_pubkey) {
43181 LDKPublicKey funding_pubkey_ref;
43182 CHECK((*env)->GetArrayLength(env, funding_pubkey) == 33);
43183 (*env)->GetByteArrayRegion(env, funding_pubkey, 0, 33, funding_pubkey_ref.compressed_form);
43184 LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_ref);
43185 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43186 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43187 CVec_u8Z_free(ret_var);
43191 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) {
43192 LDKPublicKey funding_key_ref;
43193 CHECK((*env)->GetArrayLength(env, funding_key) == 33);
43194 (*env)->GetByteArrayRegion(env, funding_key, 0, 33, funding_key_ref.compressed_form);
43195 LDKSignature funding_sig_ref;
43196 CHECK((*env)->GetArrayLength(env, funding_sig) == 64);
43197 (*env)->GetByteArrayRegion(env, funding_sig, 0, 64, funding_sig_ref.compact_form);
43198 LDKWitness ret_var = build_anchor_input_witness(funding_key_ref, funding_sig_ref);
43199 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43200 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43201 Witness_free(ret_var);
43205 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
43206 LDKChannelTransactionParameters this_obj_conv;
43207 this_obj_conv.inner = untag_ptr(this_obj);
43208 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43209 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43210 ChannelTransactionParameters_free(this_obj_conv);
43213 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr) {
43214 LDKChannelTransactionParameters this_ptr_conv;
43215 this_ptr_conv.inner = untag_ptr(this_ptr);
43216 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43217 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43218 this_ptr_conv.is_owned = false;
43219 LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv);
43220 int64_t ret_ref = 0;
43221 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43222 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43226 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1holder_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
43227 LDKChannelTransactionParameters this_ptr_conv;
43228 this_ptr_conv.inner = untag_ptr(this_ptr);
43229 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43230 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43231 this_ptr_conv.is_owned = false;
43232 LDKChannelPublicKeys val_conv;
43233 val_conv.inner = untag_ptr(val);
43234 val_conv.is_owned = ptr_is_owned(val);
43235 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
43236 val_conv = ChannelPublicKeys_clone(&val_conv);
43237 ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv);
43240 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
43241 LDKChannelTransactionParameters this_ptr_conv;
43242 this_ptr_conv.inner = untag_ptr(this_ptr);
43243 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43244 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43245 this_ptr_conv.is_owned = false;
43246 int16_t ret_conv = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv);
43250 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) {
43251 LDKChannelTransactionParameters this_ptr_conv;
43252 this_ptr_conv.inner = untag_ptr(this_ptr);
43253 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43254 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43255 this_ptr_conv.is_owned = false;
43256 ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val);
43259 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1is_1outbound_1from_1holder(JNIEnv *env, jclass clz, int64_t this_ptr) {
43260 LDKChannelTransactionParameters this_ptr_conv;
43261 this_ptr_conv.inner = untag_ptr(this_ptr);
43262 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43263 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43264 this_ptr_conv.is_owned = false;
43265 jboolean ret_conv = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv);
43269 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1is_1outbound_1from_1holder(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
43270 LDKChannelTransactionParameters this_ptr_conv;
43271 this_ptr_conv.inner = untag_ptr(this_ptr);
43272 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43273 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43274 this_ptr_conv.is_owned = false;
43275 ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val);
43278 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1counterparty_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr) {
43279 LDKChannelTransactionParameters this_ptr_conv;
43280 this_ptr_conv.inner = untag_ptr(this_ptr);
43281 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43282 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43283 this_ptr_conv.is_owned = false;
43284 LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv);
43285 int64_t ret_ref = 0;
43286 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43287 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43291 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1counterparty_1parameters(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
43292 LDKChannelTransactionParameters this_ptr_conv;
43293 this_ptr_conv.inner = untag_ptr(this_ptr);
43294 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43296 this_ptr_conv.is_owned = false;
43297 LDKCounterpartyChannelTransactionParameters val_conv;
43298 val_conv.inner = untag_ptr(val);
43299 val_conv.is_owned = ptr_is_owned(val);
43300 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
43301 val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv);
43302 ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv);
43305 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr) {
43306 LDKChannelTransactionParameters this_ptr_conv;
43307 this_ptr_conv.inner = untag_ptr(this_ptr);
43308 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43309 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43310 this_ptr_conv.is_owned = false;
43311 LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv);
43312 int64_t ret_ref = 0;
43313 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43314 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43318 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
43319 LDKChannelTransactionParameters this_ptr_conv;
43320 this_ptr_conv.inner = untag_ptr(this_ptr);
43321 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43322 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43323 this_ptr_conv.is_owned = false;
43324 LDKOutPoint val_conv;
43325 val_conv.inner = untag_ptr(val);
43326 val_conv.is_owned = ptr_is_owned(val);
43327 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
43328 val_conv = OutPoint_clone(&val_conv);
43329 ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv);
43332 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr) {
43333 LDKChannelTransactionParameters this_ptr_conv;
43334 this_ptr_conv.inner = untag_ptr(this_ptr);
43335 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43336 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43337 this_ptr_conv.is_owned = false;
43338 jclass ret_conv = LDKCOption_NoneZ_to_java(env, ChannelTransactionParameters_get_opt_anchors(&this_ptr_conv));
43342 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) {
43343 LDKChannelTransactionParameters this_ptr_conv;
43344 this_ptr_conv.inner = untag_ptr(this_ptr);
43345 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43346 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43347 this_ptr_conv.is_owned = false;
43348 LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_java(env, val);
43349 ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_conv);
43352 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1opt_1non_1zero_1fee_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr) {
43353 LDKChannelTransactionParameters this_ptr_conv;
43354 this_ptr_conv.inner = untag_ptr(this_ptr);
43355 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43356 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43357 this_ptr_conv.is_owned = false;
43358 jclass ret_conv = LDKCOption_NoneZ_to_java(env, ChannelTransactionParameters_get_opt_non_zero_fee_anchors(&this_ptr_conv));
43362 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) {
43363 LDKChannelTransactionParameters this_ptr_conv;
43364 this_ptr_conv.inner = untag_ptr(this_ptr);
43365 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43366 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43367 this_ptr_conv.is_owned = false;
43368 LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_java(env, val);
43369 ChannelTransactionParameters_set_opt_non_zero_fee_anchors(&this_ptr_conv, val_conv);
43372 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) {
43373 LDKChannelPublicKeys holder_pubkeys_arg_conv;
43374 holder_pubkeys_arg_conv.inner = untag_ptr(holder_pubkeys_arg);
43375 holder_pubkeys_arg_conv.is_owned = ptr_is_owned(holder_pubkeys_arg);
43376 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_pubkeys_arg_conv);
43377 holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv);
43378 LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv;
43379 counterparty_parameters_arg_conv.inner = untag_ptr(counterparty_parameters_arg);
43380 counterparty_parameters_arg_conv.is_owned = ptr_is_owned(counterparty_parameters_arg);
43381 CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv);
43382 counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv);
43383 LDKOutPoint funding_outpoint_arg_conv;
43384 funding_outpoint_arg_conv.inner = untag_ptr(funding_outpoint_arg);
43385 funding_outpoint_arg_conv.is_owned = ptr_is_owned(funding_outpoint_arg);
43386 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv);
43387 funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv);
43388 LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_java(env, opt_anchors_arg);
43389 LDKCOption_NoneZ opt_non_zero_fee_anchors_arg_conv = LDKCOption_NoneZ_from_java(env, opt_non_zero_fee_anchors_arg);
43390 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);
43391 int64_t ret_ref = 0;
43392 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43393 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43397 static inline uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) {
43398 LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg);
43399 int64_t ret_ref = 0;
43400 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43401 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43404 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
43405 LDKChannelTransactionParameters arg_conv;
43406 arg_conv.inner = untag_ptr(arg);
43407 arg_conv.is_owned = ptr_is_owned(arg);
43408 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43409 arg_conv.is_owned = false;
43410 int64_t ret_conv = ChannelTransactionParameters_clone_ptr(&arg_conv);
43414 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
43415 LDKChannelTransactionParameters orig_conv;
43416 orig_conv.inner = untag_ptr(orig);
43417 orig_conv.is_owned = ptr_is_owned(orig);
43418 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43419 orig_conv.is_owned = false;
43420 LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv);
43421 int64_t ret_ref = 0;
43422 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43423 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43427 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
43428 LDKChannelTransactionParameters a_conv;
43429 a_conv.inner = untag_ptr(a);
43430 a_conv.is_owned = ptr_is_owned(a);
43431 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
43432 a_conv.is_owned = false;
43433 LDKChannelTransactionParameters b_conv;
43434 b_conv.inner = untag_ptr(b);
43435 b_conv.is_owned = ptr_is_owned(b);
43436 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
43437 b_conv.is_owned = false;
43438 jboolean ret_conv = ChannelTransactionParameters_eq(&a_conv, &b_conv);
43442 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
43443 LDKCounterpartyChannelTransactionParameters this_obj_conv;
43444 this_obj_conv.inner = untag_ptr(this_obj);
43445 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43446 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43447 CounterpartyChannelTransactionParameters_free(this_obj_conv);
43450 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr) {
43451 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
43452 this_ptr_conv.inner = untag_ptr(this_ptr);
43453 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43454 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43455 this_ptr_conv.is_owned = false;
43456 LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv);
43457 int64_t ret_ref = 0;
43458 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43459 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43463 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1pubkeys(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
43464 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
43465 this_ptr_conv.inner = untag_ptr(this_ptr);
43466 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43467 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43468 this_ptr_conv.is_owned = false;
43469 LDKChannelPublicKeys val_conv;
43470 val_conv.inner = untag_ptr(val);
43471 val_conv.is_owned = ptr_is_owned(val);
43472 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
43473 val_conv = ChannelPublicKeys_clone(&val_conv);
43474 CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv);
43477 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) {
43478 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
43479 this_ptr_conv.inner = untag_ptr(this_ptr);
43480 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43481 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43482 this_ptr_conv.is_owned = false;
43483 int16_t ret_conv = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv);
43487 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
43488 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
43489 this_ptr_conv.inner = untag_ptr(this_ptr);
43490 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43491 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43492 this_ptr_conv.is_owned = false;
43493 CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val);
43496 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) {
43497 LDKChannelPublicKeys pubkeys_arg_conv;
43498 pubkeys_arg_conv.inner = untag_ptr(pubkeys_arg);
43499 pubkeys_arg_conv.is_owned = ptr_is_owned(pubkeys_arg);
43500 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv);
43501 pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv);
43502 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg);
43503 int64_t ret_ref = 0;
43504 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43505 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43509 static inline uint64_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) {
43510 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg);
43511 int64_t ret_ref = 0;
43512 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43513 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43516 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
43517 LDKCounterpartyChannelTransactionParameters arg_conv;
43518 arg_conv.inner = untag_ptr(arg);
43519 arg_conv.is_owned = ptr_is_owned(arg);
43520 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43521 arg_conv.is_owned = false;
43522 int64_t ret_conv = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv);
43526 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
43527 LDKCounterpartyChannelTransactionParameters orig_conv;
43528 orig_conv.inner = untag_ptr(orig);
43529 orig_conv.is_owned = ptr_is_owned(orig);
43530 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43531 orig_conv.is_owned = false;
43532 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv);
43533 int64_t ret_ref = 0;
43534 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43535 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43539 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
43540 LDKCounterpartyChannelTransactionParameters a_conv;
43541 a_conv.inner = untag_ptr(a);
43542 a_conv.is_owned = ptr_is_owned(a);
43543 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
43544 a_conv.is_owned = false;
43545 LDKCounterpartyChannelTransactionParameters b_conv;
43546 b_conv.inner = untag_ptr(b);
43547 b_conv.is_owned = ptr_is_owned(b);
43548 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
43549 b_conv.is_owned = false;
43550 jboolean ret_conv = CounterpartyChannelTransactionParameters_eq(&a_conv, &b_conv);
43554 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1is_1populated(JNIEnv *env, jclass clz, int64_t this_arg) {
43555 LDKChannelTransactionParameters this_arg_conv;
43556 this_arg_conv.inner = untag_ptr(this_arg);
43557 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43558 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43559 this_arg_conv.is_owned = false;
43560 jboolean ret_conv = ChannelTransactionParameters_is_populated(&this_arg_conv);
43564 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1holder_1broadcastable(JNIEnv *env, jclass clz, int64_t this_arg) {
43565 LDKChannelTransactionParameters this_arg_conv;
43566 this_arg_conv.inner = untag_ptr(this_arg);
43567 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43568 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43569 this_arg_conv.is_owned = false;
43570 LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv);
43571 int64_t ret_ref = 0;
43572 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43573 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43577 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1as_1counterparty_1broadcastable(JNIEnv *env, jclass clz, int64_t this_arg) {
43578 LDKChannelTransactionParameters this_arg_conv;
43579 this_arg_conv.inner = untag_ptr(this_arg);
43580 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43581 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43582 this_arg_conv.is_owned = false;
43583 LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv);
43584 int64_t ret_ref = 0;
43585 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43586 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43590 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
43591 LDKCounterpartyChannelTransactionParameters obj_conv;
43592 obj_conv.inner = untag_ptr(obj);
43593 obj_conv.is_owned = ptr_is_owned(obj);
43594 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43595 obj_conv.is_owned = false;
43596 LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv);
43597 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43598 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43599 CVec_u8Z_free(ret_var);
43603 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
43604 LDKu8slice ser_ref;
43605 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
43606 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
43607 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
43608 *ret_conv = CounterpartyChannelTransactionParameters_read(ser_ref);
43609 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
43610 return tag_ptr(ret_conv, true);
43613 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
43614 LDKChannelTransactionParameters obj_conv;
43615 obj_conv.inner = untag_ptr(obj);
43616 obj_conv.is_owned = ptr_is_owned(obj);
43617 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43618 obj_conv.is_owned = false;
43619 LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv);
43620 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43621 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43622 CVec_u8Z_free(ret_var);
43626 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
43627 LDKu8slice ser_ref;
43628 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
43629 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
43630 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
43631 *ret_conv = ChannelTransactionParameters_read(ser_ref);
43632 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
43633 return tag_ptr(ret_conv, true);
43636 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
43637 LDKDirectedChannelTransactionParameters this_obj_conv;
43638 this_obj_conv.inner = untag_ptr(this_obj);
43639 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43640 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43641 DirectedChannelTransactionParameters_free(this_obj_conv);
43644 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1broadcaster_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
43645 LDKDirectedChannelTransactionParameters this_arg_conv;
43646 this_arg_conv.inner = untag_ptr(this_arg);
43647 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43648 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43649 this_arg_conv.is_owned = false;
43650 LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv);
43651 int64_t ret_ref = 0;
43652 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43653 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43657 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1countersignatory_1pubkeys(JNIEnv *env, jclass clz, int64_t this_arg) {
43658 LDKDirectedChannelTransactionParameters this_arg_conv;
43659 this_arg_conv.inner = untag_ptr(this_arg);
43660 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43661 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43662 this_arg_conv.is_owned = false;
43663 LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv);
43664 int64_t ret_ref = 0;
43665 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43666 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43670 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) {
43671 LDKDirectedChannelTransactionParameters this_arg_conv;
43672 this_arg_conv.inner = untag_ptr(this_arg);
43673 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43674 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43675 this_arg_conv.is_owned = false;
43676 int16_t ret_conv = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv);
43680 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1is_1outbound(JNIEnv *env, jclass clz, int64_t this_arg) {
43681 LDKDirectedChannelTransactionParameters this_arg_conv;
43682 this_arg_conv.inner = untag_ptr(this_arg);
43683 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43684 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43685 this_arg_conv.is_owned = false;
43686 jboolean ret_conv = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv);
43690 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1funding_1outpoint(JNIEnv *env, jclass clz, int64_t this_arg) {
43691 LDKDirectedChannelTransactionParameters this_arg_conv;
43692 this_arg_conv.inner = untag_ptr(this_arg);
43693 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43694 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43695 this_arg_conv.is_owned = false;
43696 LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv);
43697 int64_t ret_ref = 0;
43698 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43699 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43703 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) {
43704 LDKDirectedChannelTransactionParameters this_arg_conv;
43705 this_arg_conv.inner = untag_ptr(this_arg);
43706 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43707 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43708 this_arg_conv.is_owned = false;
43709 jboolean ret_conv = DirectedChannelTransactionParameters_opt_anchors(&this_arg_conv);
43713 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
43714 LDKHolderCommitmentTransaction this_obj_conv;
43715 this_obj_conv.inner = untag_ptr(this_obj);
43716 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43717 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43718 HolderCommitmentTransaction_free(this_obj_conv);
43721 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr) {
43722 LDKHolderCommitmentTransaction this_ptr_conv;
43723 this_ptr_conv.inner = untag_ptr(this_ptr);
43724 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43725 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43726 this_ptr_conv.is_owned = false;
43727 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
43728 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form);
43732 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
43733 LDKHolderCommitmentTransaction this_ptr_conv;
43734 this_ptr_conv.inner = untag_ptr(this_ptr);
43735 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43736 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43737 this_ptr_conv.is_owned = false;
43738 LDKSignature val_ref;
43739 CHECK((*env)->GetArrayLength(env, val) == 64);
43740 (*env)->GetByteArrayRegion(env, val, 0, 64, val_ref.compact_form);
43741 HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref);
43744 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1htlc_1sigs(JNIEnv *env, jclass clz, int64_t this_ptr) {
43745 LDKHolderCommitmentTransaction this_ptr_conv;
43746 this_ptr_conv.inner = untag_ptr(this_ptr);
43747 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43748 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43749 this_ptr_conv.is_owned = false;
43750 LDKCVec_SignatureZ ret_var = HolderCommitmentTransaction_get_counterparty_htlc_sigs(&this_ptr_conv);
43751 jobjectArray ret_arr = NULL;
43752 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
43754 for (size_t i = 0; i < ret_var.datalen; i++) {
43755 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 64);
43756 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 64, ret_var.data[i].compact_form);
43757 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
43760 FREE(ret_var.data);
43764 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1htlc_1sigs(JNIEnv *env, jclass clz, int64_t this_ptr, jobjectArray val) {
43765 LDKHolderCommitmentTransaction this_ptr_conv;
43766 this_ptr_conv.inner = untag_ptr(this_ptr);
43767 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43768 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43769 this_ptr_conv.is_owned = false;
43770 LDKCVec_SignatureZ val_constr;
43771 val_constr.datalen = (*env)->GetArrayLength(env, val);
43772 if (val_constr.datalen > 0)
43773 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
43775 val_constr.data = NULL;
43776 for (size_t i = 0; i < val_constr.datalen; i++) {
43777 int8_tArray val_conv_8 = (*env)->GetObjectArrayElement(env, val, i);
43778 LDKSignature val_conv_8_ref;
43779 CHECK((*env)->GetArrayLength(env, val_conv_8) == 64);
43780 (*env)->GetByteArrayRegion(env, val_conv_8, 0, 64, val_conv_8_ref.compact_form);
43781 val_constr.data[i] = val_conv_8_ref;
43783 HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr);
43786 static inline uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) {
43787 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg);
43788 int64_t ret_ref = 0;
43789 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43790 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43793 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
43794 LDKHolderCommitmentTransaction arg_conv;
43795 arg_conv.inner = untag_ptr(arg);
43796 arg_conv.is_owned = ptr_is_owned(arg);
43797 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43798 arg_conv.is_owned = false;
43799 int64_t ret_conv = HolderCommitmentTransaction_clone_ptr(&arg_conv);
43803 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
43804 LDKHolderCommitmentTransaction orig_conv;
43805 orig_conv.inner = untag_ptr(orig);
43806 orig_conv.is_owned = ptr_is_owned(orig);
43807 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43808 orig_conv.is_owned = false;
43809 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv);
43810 int64_t ret_ref = 0;
43811 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43812 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43816 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) {
43817 LDKHolderCommitmentTransaction obj_conv;
43818 obj_conv.inner = untag_ptr(obj);
43819 obj_conv.is_owned = ptr_is_owned(obj);
43820 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43821 obj_conv.is_owned = false;
43822 LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv);
43823 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43824 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43825 CVec_u8Z_free(ret_var);
43829 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
43830 LDKu8slice ser_ref;
43831 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
43832 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
43833 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
43834 *ret_conv = HolderCommitmentTransaction_read(ser_ref);
43835 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
43836 return tag_ptr(ret_conv, true);
43839 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) {
43840 LDKCommitmentTransaction commitment_tx_conv;
43841 commitment_tx_conv.inner = untag_ptr(commitment_tx);
43842 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
43843 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
43844 commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv);
43845 LDKSignature counterparty_sig_ref;
43846 CHECK((*env)->GetArrayLength(env, counterparty_sig) == 64);
43847 (*env)->GetByteArrayRegion(env, counterparty_sig, 0, 64, counterparty_sig_ref.compact_form);
43848 LDKCVec_SignatureZ counterparty_htlc_sigs_constr;
43849 counterparty_htlc_sigs_constr.datalen = (*env)->GetArrayLength(env, counterparty_htlc_sigs);
43850 if (counterparty_htlc_sigs_constr.datalen > 0)
43851 counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
43853 counterparty_htlc_sigs_constr.data = NULL;
43854 for (size_t i = 0; i < counterparty_htlc_sigs_constr.datalen; i++) {
43855 int8_tArray counterparty_htlc_sigs_conv_8 = (*env)->GetObjectArrayElement(env, counterparty_htlc_sigs, i);
43856 LDKSignature counterparty_htlc_sigs_conv_8_ref;
43857 CHECK((*env)->GetArrayLength(env, counterparty_htlc_sigs_conv_8) == 64);
43858 (*env)->GetByteArrayRegion(env, counterparty_htlc_sigs_conv_8, 0, 64, counterparty_htlc_sigs_conv_8_ref.compact_form);
43859 counterparty_htlc_sigs_constr.data[i] = counterparty_htlc_sigs_conv_8_ref;
43861 LDKPublicKey holder_funding_key_ref;
43862 CHECK((*env)->GetArrayLength(env, holder_funding_key) == 33);
43863 (*env)->GetByteArrayRegion(env, holder_funding_key, 0, 33, holder_funding_key_ref.compressed_form);
43864 LDKPublicKey counterparty_funding_key_ref;
43865 CHECK((*env)->GetArrayLength(env, counterparty_funding_key) == 33);
43866 (*env)->GetByteArrayRegion(env, counterparty_funding_key, 0, 33, counterparty_funding_key_ref.compressed_form);
43867 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_ref);
43868 int64_t ret_ref = 0;
43869 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43870 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43874 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
43875 LDKBuiltCommitmentTransaction this_obj_conv;
43876 this_obj_conv.inner = untag_ptr(this_obj);
43877 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43878 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43879 BuiltCommitmentTransaction_free(this_obj_conv);
43882 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1transaction(JNIEnv *env, jclass clz, int64_t this_ptr) {
43883 LDKBuiltCommitmentTransaction this_ptr_conv;
43884 this_ptr_conv.inner = untag_ptr(this_ptr);
43885 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43886 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43887 this_ptr_conv.is_owned = false;
43888 LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv);
43889 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43890 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43891 Transaction_free(ret_var);
43895 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1transaction(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
43896 LDKBuiltCommitmentTransaction this_ptr_conv;
43897 this_ptr_conv.inner = untag_ptr(this_ptr);
43898 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43899 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43900 this_ptr_conv.is_owned = false;
43901 LDKTransaction val_ref;
43902 val_ref.datalen = (*env)->GetArrayLength(env, val);
43903 val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes");
43904 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
43905 val_ref.data_is_owned = true;
43906 BuiltCommitmentTransaction_set_transaction(&this_ptr_conv, val_ref);
43909 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1get_1txid(JNIEnv *env, jclass clz, int64_t this_ptr) {
43910 LDKBuiltCommitmentTransaction this_ptr_conv;
43911 this_ptr_conv.inner = untag_ptr(this_ptr);
43912 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43913 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43914 this_ptr_conv.is_owned = false;
43915 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
43916 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv));
43920 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1set_1txid(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
43921 LDKBuiltCommitmentTransaction this_ptr_conv;
43922 this_ptr_conv.inner = untag_ptr(this_ptr);
43923 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
43924 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
43925 this_ptr_conv.is_owned = false;
43926 LDKThirtyTwoBytes val_ref;
43927 CHECK((*env)->GetArrayLength(env, val) == 32);
43928 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
43929 BuiltCommitmentTransaction_set_txid(&this_ptr_conv, val_ref);
43932 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1new(JNIEnv *env, jclass clz, int8_tArray transaction_arg, int8_tArray txid_arg) {
43933 LDKTransaction transaction_arg_ref;
43934 transaction_arg_ref.datalen = (*env)->GetArrayLength(env, transaction_arg);
43935 transaction_arg_ref.data = MALLOC(transaction_arg_ref.datalen, "LDKTransaction Bytes");
43936 (*env)->GetByteArrayRegion(env, transaction_arg, 0, transaction_arg_ref.datalen, transaction_arg_ref.data);
43937 transaction_arg_ref.data_is_owned = true;
43938 LDKThirtyTwoBytes txid_arg_ref;
43939 CHECK((*env)->GetArrayLength(env, txid_arg) == 32);
43940 (*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data);
43941 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_ref);
43942 int64_t ret_ref = 0;
43943 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43944 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43948 static inline uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) {
43949 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg);
43950 int64_t ret_ref = 0;
43951 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43952 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43955 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
43956 LDKBuiltCommitmentTransaction arg_conv;
43957 arg_conv.inner = untag_ptr(arg);
43958 arg_conv.is_owned = ptr_is_owned(arg);
43959 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
43960 arg_conv.is_owned = false;
43961 int64_t ret_conv = BuiltCommitmentTransaction_clone_ptr(&arg_conv);
43965 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
43966 LDKBuiltCommitmentTransaction orig_conv;
43967 orig_conv.inner = untag_ptr(orig);
43968 orig_conv.is_owned = ptr_is_owned(orig);
43969 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
43970 orig_conv.is_owned = false;
43971 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv);
43972 int64_t ret_ref = 0;
43973 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43974 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43978 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) {
43979 LDKBuiltCommitmentTransaction obj_conv;
43980 obj_conv.inner = untag_ptr(obj);
43981 obj_conv.is_owned = ptr_is_owned(obj);
43982 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
43983 obj_conv.is_owned = false;
43984 LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv);
43985 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
43986 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
43987 CVec_u8Z_free(ret_var);
43991 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
43992 LDKu8slice ser_ref;
43993 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
43994 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
43995 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
43996 *ret_conv = BuiltCommitmentTransaction_read(ser_ref);
43997 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
43998 return tag_ptr(ret_conv, true);
44001 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) {
44002 LDKBuiltCommitmentTransaction this_arg_conv;
44003 this_arg_conv.inner = untag_ptr(this_arg);
44004 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44005 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44006 this_arg_conv.is_owned = false;
44007 LDKu8slice funding_redeemscript_ref;
44008 funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
44009 funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
44010 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
44011 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data);
44012 (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
44016 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1sign_1counterparty_1commitment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis) {
44017 LDKBuiltCommitmentTransaction this_arg_conv;
44018 this_arg_conv.inner = untag_ptr(this_arg);
44019 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44020 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44021 this_arg_conv.is_owned = false;
44022 uint8_t funding_key_arr[32];
44023 CHECK((*env)->GetArrayLength(env, funding_key) == 32);
44024 (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr);
44025 uint8_t (*funding_key_ref)[32] = &funding_key_arr;
44026 LDKu8slice funding_redeemscript_ref;
44027 funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
44028 funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
44029 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
44030 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, BuiltCommitmentTransaction_sign_counterparty_commitment(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form);
44031 (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
44035 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BuiltCommitmentTransaction_1sign_1holder_1commitment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray funding_key, int8_tArray funding_redeemscript, int64_t channel_value_satoshis, int64_t entropy_source) {
44036 LDKBuiltCommitmentTransaction this_arg_conv;
44037 this_arg_conv.inner = untag_ptr(this_arg);
44038 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44039 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44040 this_arg_conv.is_owned = false;
44041 uint8_t funding_key_arr[32];
44042 CHECK((*env)->GetArrayLength(env, funding_key) == 32);
44043 (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr);
44044 uint8_t (*funding_key_ref)[32] = &funding_key_arr;
44045 LDKu8slice funding_redeemscript_ref;
44046 funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
44047 funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
44048 void* entropy_source_ptr = untag_ptr(entropy_source);
44049 if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); }
44050 LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr;
44051 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
44052 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, BuiltCommitmentTransaction_sign_holder_commitment(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis, entropy_source_conv).compact_form);
44053 (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
44057 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44058 LDKClosingTransaction this_obj_conv;
44059 this_obj_conv.inner = untag_ptr(this_obj);
44060 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44061 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44062 ClosingTransaction_free(this_obj_conv);
44065 static inline uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) {
44066 LDKClosingTransaction ret_var = ClosingTransaction_clone(arg);
44067 int64_t ret_ref = 0;
44068 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44069 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44072 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44073 LDKClosingTransaction arg_conv;
44074 arg_conv.inner = untag_ptr(arg);
44075 arg_conv.is_owned = ptr_is_owned(arg);
44076 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44077 arg_conv.is_owned = false;
44078 int64_t ret_conv = ClosingTransaction_clone_ptr(&arg_conv);
44082 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44083 LDKClosingTransaction orig_conv;
44084 orig_conv.inner = untag_ptr(orig);
44085 orig_conv.is_owned = ptr_is_owned(orig);
44086 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44087 orig_conv.is_owned = false;
44088 LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv);
44089 int64_t ret_ref = 0;
44090 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44091 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44095 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1hash(JNIEnv *env, jclass clz, int64_t o) {
44096 LDKClosingTransaction o_conv;
44097 o_conv.inner = untag_ptr(o);
44098 o_conv.is_owned = ptr_is_owned(o);
44099 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
44100 o_conv.is_owned = false;
44101 int64_t ret_conv = ClosingTransaction_hash(&o_conv);
44105 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44106 LDKClosingTransaction a_conv;
44107 a_conv.inner = untag_ptr(a);
44108 a_conv.is_owned = ptr_is_owned(a);
44109 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44110 a_conv.is_owned = false;
44111 LDKClosingTransaction b_conv;
44112 b_conv.inner = untag_ptr(b);
44113 b_conv.is_owned = ptr_is_owned(b);
44114 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44115 b_conv.is_owned = false;
44116 jboolean ret_conv = ClosingTransaction_eq(&a_conv, &b_conv);
44120 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) {
44121 LDKCVec_u8Z to_holder_script_ref;
44122 to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script);
44123 to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes");
44124 (*env)->GetByteArrayRegion(env, to_holder_script, 0, to_holder_script_ref.datalen, to_holder_script_ref.data);
44125 LDKCVec_u8Z to_counterparty_script_ref;
44126 to_counterparty_script_ref.datalen = (*env)->GetArrayLength(env, to_counterparty_script);
44127 to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes");
44128 (*env)->GetByteArrayRegion(env, to_counterparty_script, 0, to_counterparty_script_ref.datalen, to_counterparty_script_ref.data);
44129 LDKOutPoint funding_outpoint_conv;
44130 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
44131 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
44132 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
44133 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
44134 LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv);
44135 int64_t ret_ref = 0;
44136 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44137 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44141 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1trust(JNIEnv *env, jclass clz, int64_t this_arg) {
44142 LDKClosingTransaction this_arg_conv;
44143 this_arg_conv.inner = untag_ptr(this_arg);
44144 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44145 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44146 this_arg_conv.is_owned = false;
44147 LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv);
44148 int64_t ret_ref = 0;
44149 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44150 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44154 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1verify(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_outpoint) {
44155 LDKClosingTransaction this_arg_conv;
44156 this_arg_conv.inner = untag_ptr(this_arg);
44157 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44158 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44159 this_arg_conv.is_owned = false;
44160 LDKOutPoint funding_outpoint_conv;
44161 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
44162 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
44163 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
44164 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
44165 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
44166 *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv);
44167 return tag_ptr(ret_conv, true);
44170 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) {
44171 LDKClosingTransaction this_arg_conv;
44172 this_arg_conv.inner = untag_ptr(this_arg);
44173 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44174 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44175 this_arg_conv.is_owned = false;
44176 int64_t ret_conv = ClosingTransaction_to_holder_value_sat(&this_arg_conv);
44180 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) {
44181 LDKClosingTransaction this_arg_conv;
44182 this_arg_conv.inner = untag_ptr(this_arg);
44183 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44184 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44185 this_arg_conv.is_owned = false;
44186 int64_t ret_conv = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv);
44190 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1holder_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
44191 LDKClosingTransaction this_arg_conv;
44192 this_arg_conv.inner = untag_ptr(this_arg);
44193 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44194 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44195 this_arg_conv.is_owned = false;
44196 LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv);
44197 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44198 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44202 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1to_1counterparty_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
44203 LDKClosingTransaction this_arg_conv;
44204 this_arg_conv.inner = untag_ptr(this_arg);
44205 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44206 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44207 this_arg_conv.is_owned = false;
44208 LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv);
44209 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44210 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44214 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44215 LDKTrustedClosingTransaction this_obj_conv;
44216 this_obj_conv.inner = untag_ptr(this_obj);
44217 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44218 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44219 TrustedClosingTransaction_free(this_obj_conv);
44222 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedClosingTransaction_1built_1transaction(JNIEnv *env, jclass clz, int64_t this_arg) {
44223 LDKTrustedClosingTransaction this_arg_conv;
44224 this_arg_conv.inner = untag_ptr(this_arg);
44225 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44226 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44227 this_arg_conv.is_owned = false;
44228 LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv);
44229 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44230 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44231 Transaction_free(ret_var);
44235 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) {
44236 LDKTrustedClosingTransaction this_arg_conv;
44237 this_arg_conv.inner = untag_ptr(this_arg);
44238 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44239 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44240 this_arg_conv.is_owned = false;
44241 LDKu8slice funding_redeemscript_ref;
44242 funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
44243 funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
44244 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
44245 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedClosingTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data);
44246 (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
44250 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) {
44251 LDKTrustedClosingTransaction this_arg_conv;
44252 this_arg_conv.inner = untag_ptr(this_arg);
44253 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44254 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44255 this_arg_conv.is_owned = false;
44256 uint8_t funding_key_arr[32];
44257 CHECK((*env)->GetArrayLength(env, funding_key) == 32);
44258 (*env)->GetByteArrayRegion(env, funding_key, 0, 32, funding_key_arr);
44259 uint8_t (*funding_key_ref)[32] = &funding_key_arr;
44260 LDKu8slice funding_redeemscript_ref;
44261 funding_redeemscript_ref.datalen = (*env)->GetArrayLength(env, funding_redeemscript);
44262 funding_redeemscript_ref.data = (*env)->GetByteArrayElements (env, funding_redeemscript, NULL);
44263 int8_tArray ret_arr = (*env)->NewByteArray(env, 64);
44264 (*env)->SetByteArrayRegion(env, ret_arr, 0, 64, TrustedClosingTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form);
44265 (*env)->ReleaseByteArrayElements(env, funding_redeemscript, (int8_t*)funding_redeemscript_ref.data, 0);
44269 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44270 LDKCommitmentTransaction this_obj_conv;
44271 this_obj_conv.inner = untag_ptr(this_obj);
44272 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44273 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44274 CommitmentTransaction_free(this_obj_conv);
44277 static inline uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) {
44278 LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg);
44279 int64_t ret_ref = 0;
44280 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44281 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44284 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44285 LDKCommitmentTransaction arg_conv;
44286 arg_conv.inner = untag_ptr(arg);
44287 arg_conv.is_owned = ptr_is_owned(arg);
44288 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44289 arg_conv.is_owned = false;
44290 int64_t ret_conv = CommitmentTransaction_clone_ptr(&arg_conv);
44294 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44295 LDKCommitmentTransaction orig_conv;
44296 orig_conv.inner = untag_ptr(orig);
44297 orig_conv.is_owned = ptr_is_owned(orig);
44298 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44299 orig_conv.is_owned = false;
44300 LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv);
44301 int64_t ret_ref = 0;
44302 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44303 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44307 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1write(JNIEnv *env, jclass clz, int64_t obj) {
44308 LDKCommitmentTransaction obj_conv;
44309 obj_conv.inner = untag_ptr(obj);
44310 obj_conv.is_owned = ptr_is_owned(obj);
44311 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
44312 obj_conv.is_owned = false;
44313 LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv);
44314 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
44315 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
44316 CVec_u8Z_free(ret_var);
44320 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
44321 LDKu8slice ser_ref;
44322 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
44323 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
44324 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
44325 *ret_conv = CommitmentTransaction_read(ser_ref);
44326 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
44327 return tag_ptr(ret_conv, true);
44330 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1commitment_1number(JNIEnv *env, jclass clz, int64_t this_arg) {
44331 LDKCommitmentTransaction this_arg_conv;
44332 this_arg_conv.inner = untag_ptr(this_arg);
44333 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44334 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44335 this_arg_conv.is_owned = false;
44336 int64_t ret_conv = CommitmentTransaction_commitment_number(&this_arg_conv);
44340 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1broadcaster_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) {
44341 LDKCommitmentTransaction this_arg_conv;
44342 this_arg_conv.inner = untag_ptr(this_arg);
44343 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44344 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44345 this_arg_conv.is_owned = false;
44346 int64_t ret_conv = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv);
44350 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1to_1countersignatory_1value_1sat(JNIEnv *env, jclass clz, int64_t this_arg) {
44351 LDKCommitmentTransaction this_arg_conv;
44352 this_arg_conv.inner = untag_ptr(this_arg);
44353 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44354 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44355 this_arg_conv.is_owned = false;
44356 int64_t ret_conv = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv);
44360 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1feerate_1per_1kw(JNIEnv *env, jclass clz, int64_t this_arg) {
44361 LDKCommitmentTransaction this_arg_conv;
44362 this_arg_conv.inner = untag_ptr(this_arg);
44363 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44364 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44365 this_arg_conv.is_owned = false;
44366 int32_t ret_conv = CommitmentTransaction_feerate_per_kw(&this_arg_conv);
44370 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CommitmentTransaction_1trust(JNIEnv *env, jclass clz, int64_t this_arg) {
44371 LDKCommitmentTransaction this_arg_conv;
44372 this_arg_conv.inner = untag_ptr(this_arg);
44373 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44374 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44375 this_arg_conv.is_owned = false;
44376 LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv);
44377 int64_t ret_ref = 0;
44378 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44379 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44383 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) {
44384 LDKCommitmentTransaction this_arg_conv;
44385 this_arg_conv.inner = untag_ptr(this_arg);
44386 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44387 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44388 this_arg_conv.is_owned = false;
44389 LDKDirectedChannelTransactionParameters channel_parameters_conv;
44390 channel_parameters_conv.inner = untag_ptr(channel_parameters);
44391 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
44392 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
44393 channel_parameters_conv.is_owned = false;
44394 LDKChannelPublicKeys broadcaster_keys_conv;
44395 broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys);
44396 broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys);
44397 CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
44398 broadcaster_keys_conv.is_owned = false;
44399 LDKChannelPublicKeys countersignatory_keys_conv;
44400 countersignatory_keys_conv.inner = untag_ptr(countersignatory_keys);
44401 countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys);
44402 CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
44403 countersignatory_keys_conv.is_owned = false;
44404 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
44405 *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv);
44406 return tag_ptr(ret_conv, true);
44409 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44410 LDKTrustedCommitmentTransaction this_obj_conv;
44411 this_obj_conv.inner = untag_ptr(this_obj);
44412 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44413 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44414 TrustedCommitmentTransaction_free(this_obj_conv);
44417 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1txid(JNIEnv *env, jclass clz, int64_t this_arg) {
44418 LDKTrustedCommitmentTransaction this_arg_conv;
44419 this_arg_conv.inner = untag_ptr(this_arg);
44420 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44421 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44422 this_arg_conv.is_owned = false;
44423 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
44424 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, TrustedCommitmentTransaction_txid(&this_arg_conv).data);
44428 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1built_1transaction(JNIEnv *env, jclass clz, int64_t this_arg) {
44429 LDKTrustedCommitmentTransaction this_arg_conv;
44430 this_arg_conv.inner = untag_ptr(this_arg);
44431 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44432 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44433 this_arg_conv.is_owned = false;
44434 LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv);
44435 int64_t ret_ref = 0;
44436 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44437 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44441 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1keys(JNIEnv *env, jclass clz, int64_t this_arg) {
44442 LDKTrustedCommitmentTransaction this_arg_conv;
44443 this_arg_conv.inner = untag_ptr(this_arg);
44444 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44445 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44446 this_arg_conv.is_owned = false;
44447 LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv);
44448 int64_t ret_ref = 0;
44449 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44450 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44454 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_TrustedCommitmentTransaction_1opt_1anchors(JNIEnv *env, jclass clz, int64_t this_arg) {
44455 LDKTrustedCommitmentTransaction this_arg_conv;
44456 this_arg_conv.inner = untag_ptr(this_arg);
44457 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44458 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44459 this_arg_conv.is_owned = false;
44460 jboolean ret_conv = TrustedCommitmentTransaction_opt_anchors(&this_arg_conv);
44464 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, int64_t entropy_source) {
44465 LDKTrustedCommitmentTransaction this_arg_conv;
44466 this_arg_conv.inner = untag_ptr(this_arg);
44467 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44468 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44469 this_arg_conv.is_owned = false;
44470 uint8_t htlc_base_key_arr[32];
44471 CHECK((*env)->GetArrayLength(env, htlc_base_key) == 32);
44472 (*env)->GetByteArrayRegion(env, htlc_base_key, 0, 32, htlc_base_key_arr);
44473 uint8_t (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
44474 LDKDirectedChannelTransactionParameters channel_parameters_conv;
44475 channel_parameters_conv.inner = untag_ptr(channel_parameters);
44476 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
44477 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
44478 channel_parameters_conv.is_owned = false;
44479 void* entropy_source_ptr = untag_ptr(entropy_source);
44480 if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); }
44481 LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr;
44482 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
44483 *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv, entropy_source_conv);
44484 return tag_ptr(ret_conv, true);
44487 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) {
44488 LDKPublicKey broadcaster_payment_basepoint_ref;
44489 CHECK((*env)->GetArrayLength(env, broadcaster_payment_basepoint) == 33);
44490 (*env)->GetByteArrayRegion(env, broadcaster_payment_basepoint, 0, 33, broadcaster_payment_basepoint_ref.compressed_form);
44491 LDKPublicKey countersignatory_payment_basepoint_ref;
44492 CHECK((*env)->GetArrayLength(env, countersignatory_payment_basepoint) == 33);
44493 (*env)->GetByteArrayRegion(env, countersignatory_payment_basepoint, 0, 33, countersignatory_payment_basepoint_ref.compressed_form);
44494 int64_t ret_conv = get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint_ref, countersignatory_payment_basepoint_ref, outbound_from_broadcaster);
44498 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44499 LDKInitFeatures a_conv;
44500 a_conv.inner = untag_ptr(a);
44501 a_conv.is_owned = ptr_is_owned(a);
44502 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44503 a_conv.is_owned = false;
44504 LDKInitFeatures b_conv;
44505 b_conv.inner = untag_ptr(b);
44506 b_conv.is_owned = ptr_is_owned(b);
44507 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44508 b_conv.is_owned = false;
44509 jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv);
44513 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44514 LDKNodeFeatures a_conv;
44515 a_conv.inner = untag_ptr(a);
44516 a_conv.is_owned = ptr_is_owned(a);
44517 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44518 a_conv.is_owned = false;
44519 LDKNodeFeatures b_conv;
44520 b_conv.inner = untag_ptr(b);
44521 b_conv.is_owned = ptr_is_owned(b);
44522 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44523 b_conv.is_owned = false;
44524 jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv);
44528 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44529 LDKChannelFeatures a_conv;
44530 a_conv.inner = untag_ptr(a);
44531 a_conv.is_owned = ptr_is_owned(a);
44532 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44533 a_conv.is_owned = false;
44534 LDKChannelFeatures b_conv;
44535 b_conv.inner = untag_ptr(b);
44536 b_conv.is_owned = ptr_is_owned(b);
44537 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44538 b_conv.is_owned = false;
44539 jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv);
44543 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44544 LDKInvoiceFeatures a_conv;
44545 a_conv.inner = untag_ptr(a);
44546 a_conv.is_owned = ptr_is_owned(a);
44547 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44548 a_conv.is_owned = false;
44549 LDKInvoiceFeatures b_conv;
44550 b_conv.inner = untag_ptr(b);
44551 b_conv.is_owned = ptr_is_owned(b);
44552 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44553 b_conv.is_owned = false;
44554 jboolean ret_conv = InvoiceFeatures_eq(&a_conv, &b_conv);
44558 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44559 LDKOfferFeatures a_conv;
44560 a_conv.inner = untag_ptr(a);
44561 a_conv.is_owned = ptr_is_owned(a);
44562 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44563 a_conv.is_owned = false;
44564 LDKOfferFeatures b_conv;
44565 b_conv.inner = untag_ptr(b);
44566 b_conv.is_owned = ptr_is_owned(b);
44567 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44568 b_conv.is_owned = false;
44569 jboolean ret_conv = OfferFeatures_eq(&a_conv, &b_conv);
44573 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44574 LDKInvoiceRequestFeatures a_conv;
44575 a_conv.inner = untag_ptr(a);
44576 a_conv.is_owned = ptr_is_owned(a);
44577 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44578 a_conv.is_owned = false;
44579 LDKInvoiceRequestFeatures b_conv;
44580 b_conv.inner = untag_ptr(b);
44581 b_conv.is_owned = ptr_is_owned(b);
44582 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44583 b_conv.is_owned = false;
44584 jboolean ret_conv = InvoiceRequestFeatures_eq(&a_conv, &b_conv);
44588 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44589 LDKBolt12InvoiceFeatures a_conv;
44590 a_conv.inner = untag_ptr(a);
44591 a_conv.is_owned = ptr_is_owned(a);
44592 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44593 a_conv.is_owned = false;
44594 LDKBolt12InvoiceFeatures b_conv;
44595 b_conv.inner = untag_ptr(b);
44596 b_conv.is_owned = ptr_is_owned(b);
44597 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44598 b_conv.is_owned = false;
44599 jboolean ret_conv = Bolt12InvoiceFeatures_eq(&a_conv, &b_conv);
44603 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44604 LDKBlindedHopFeatures a_conv;
44605 a_conv.inner = untag_ptr(a);
44606 a_conv.is_owned = ptr_is_owned(a);
44607 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44608 a_conv.is_owned = false;
44609 LDKBlindedHopFeatures b_conv;
44610 b_conv.inner = untag_ptr(b);
44611 b_conv.is_owned = ptr_is_owned(b);
44612 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44613 b_conv.is_owned = false;
44614 jboolean ret_conv = BlindedHopFeatures_eq(&a_conv, &b_conv);
44618 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
44619 LDKChannelTypeFeatures a_conv;
44620 a_conv.inner = untag_ptr(a);
44621 a_conv.is_owned = ptr_is_owned(a);
44622 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
44623 a_conv.is_owned = false;
44624 LDKChannelTypeFeatures b_conv;
44625 b_conv.inner = untag_ptr(b);
44626 b_conv.is_owned = ptr_is_owned(b);
44627 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
44628 b_conv.is_owned = false;
44629 jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv);
44633 static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) {
44634 LDKInitFeatures ret_var = InitFeatures_clone(arg);
44635 int64_t ret_ref = 0;
44636 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44637 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44640 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44641 LDKInitFeatures arg_conv;
44642 arg_conv.inner = untag_ptr(arg);
44643 arg_conv.is_owned = ptr_is_owned(arg);
44644 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44645 arg_conv.is_owned = false;
44646 int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv);
44650 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44651 LDKInitFeatures orig_conv;
44652 orig_conv.inner = untag_ptr(orig);
44653 orig_conv.is_owned = ptr_is_owned(orig);
44654 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44655 orig_conv.is_owned = false;
44656 LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv);
44657 int64_t ret_ref = 0;
44658 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44659 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44663 static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) {
44664 LDKNodeFeatures ret_var = NodeFeatures_clone(arg);
44665 int64_t ret_ref = 0;
44666 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44667 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44670 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44671 LDKNodeFeatures arg_conv;
44672 arg_conv.inner = untag_ptr(arg);
44673 arg_conv.is_owned = ptr_is_owned(arg);
44674 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44675 arg_conv.is_owned = false;
44676 int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv);
44680 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44681 LDKNodeFeatures orig_conv;
44682 orig_conv.inner = untag_ptr(orig);
44683 orig_conv.is_owned = ptr_is_owned(orig);
44684 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44685 orig_conv.is_owned = false;
44686 LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv);
44687 int64_t ret_ref = 0;
44688 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44689 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44693 static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) {
44694 LDKChannelFeatures ret_var = ChannelFeatures_clone(arg);
44695 int64_t ret_ref = 0;
44696 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44697 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44700 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44701 LDKChannelFeatures arg_conv;
44702 arg_conv.inner = untag_ptr(arg);
44703 arg_conv.is_owned = ptr_is_owned(arg);
44704 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44705 arg_conv.is_owned = false;
44706 int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv);
44710 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44711 LDKChannelFeatures orig_conv;
44712 orig_conv.inner = untag_ptr(orig);
44713 orig_conv.is_owned = ptr_is_owned(orig);
44714 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44715 orig_conv.is_owned = false;
44716 LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv);
44717 int64_t ret_ref = 0;
44718 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44719 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44723 static inline uint64_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) {
44724 LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg);
44725 int64_t ret_ref = 0;
44726 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44727 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44730 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44731 LDKInvoiceFeatures arg_conv;
44732 arg_conv.inner = untag_ptr(arg);
44733 arg_conv.is_owned = ptr_is_owned(arg);
44734 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44735 arg_conv.is_owned = false;
44736 int64_t ret_conv = InvoiceFeatures_clone_ptr(&arg_conv);
44740 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44741 LDKInvoiceFeatures orig_conv;
44742 orig_conv.inner = untag_ptr(orig);
44743 orig_conv.is_owned = ptr_is_owned(orig);
44744 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44745 orig_conv.is_owned = false;
44746 LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv);
44747 int64_t ret_ref = 0;
44748 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44749 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44753 static inline uint64_t OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg) {
44754 LDKOfferFeatures ret_var = OfferFeatures_clone(arg);
44755 int64_t ret_ref = 0;
44756 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44757 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44760 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44761 LDKOfferFeatures arg_conv;
44762 arg_conv.inner = untag_ptr(arg);
44763 arg_conv.is_owned = ptr_is_owned(arg);
44764 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44765 arg_conv.is_owned = false;
44766 int64_t ret_conv = OfferFeatures_clone_ptr(&arg_conv);
44770 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44771 LDKOfferFeatures orig_conv;
44772 orig_conv.inner = untag_ptr(orig);
44773 orig_conv.is_owned = ptr_is_owned(orig);
44774 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44775 orig_conv.is_owned = false;
44776 LDKOfferFeatures ret_var = OfferFeatures_clone(&orig_conv);
44777 int64_t ret_ref = 0;
44778 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44779 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44783 static inline uint64_t InvoiceRequestFeatures_clone_ptr(LDKInvoiceRequestFeatures *NONNULL_PTR arg) {
44784 LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(arg);
44785 int64_t ret_ref = 0;
44786 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44787 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44790 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44791 LDKInvoiceRequestFeatures arg_conv;
44792 arg_conv.inner = untag_ptr(arg);
44793 arg_conv.is_owned = ptr_is_owned(arg);
44794 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44795 arg_conv.is_owned = false;
44796 int64_t ret_conv = InvoiceRequestFeatures_clone_ptr(&arg_conv);
44800 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44801 LDKInvoiceRequestFeatures orig_conv;
44802 orig_conv.inner = untag_ptr(orig);
44803 orig_conv.is_owned = ptr_is_owned(orig);
44804 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44805 orig_conv.is_owned = false;
44806 LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(&orig_conv);
44807 int64_t ret_ref = 0;
44808 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44809 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44813 static inline uint64_t Bolt12InvoiceFeatures_clone_ptr(LDKBolt12InvoiceFeatures *NONNULL_PTR arg) {
44814 LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(arg);
44815 int64_t ret_ref = 0;
44816 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44817 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44820 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44821 LDKBolt12InvoiceFeatures arg_conv;
44822 arg_conv.inner = untag_ptr(arg);
44823 arg_conv.is_owned = ptr_is_owned(arg);
44824 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44825 arg_conv.is_owned = false;
44826 int64_t ret_conv = Bolt12InvoiceFeatures_clone_ptr(&arg_conv);
44830 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44831 LDKBolt12InvoiceFeatures orig_conv;
44832 orig_conv.inner = untag_ptr(orig);
44833 orig_conv.is_owned = ptr_is_owned(orig);
44834 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44835 orig_conv.is_owned = false;
44836 LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_clone(&orig_conv);
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 static inline uint64_t BlindedHopFeatures_clone_ptr(LDKBlindedHopFeatures *NONNULL_PTR arg) {
44844 LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(arg);
44845 int64_t ret_ref = 0;
44846 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44847 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44850 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44851 LDKBlindedHopFeatures arg_conv;
44852 arg_conv.inner = untag_ptr(arg);
44853 arg_conv.is_owned = ptr_is_owned(arg);
44854 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44855 arg_conv.is_owned = false;
44856 int64_t ret_conv = BlindedHopFeatures_clone_ptr(&arg_conv);
44860 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44861 LDKBlindedHopFeatures orig_conv;
44862 orig_conv.inner = untag_ptr(orig);
44863 orig_conv.is_owned = ptr_is_owned(orig);
44864 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44865 orig_conv.is_owned = false;
44866 LDKBlindedHopFeatures ret_var = BlindedHopFeatures_clone(&orig_conv);
44867 int64_t ret_ref = 0;
44868 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44869 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44873 static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) {
44874 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg);
44875 int64_t ret_ref = 0;
44876 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44877 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44880 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
44881 LDKChannelTypeFeatures arg_conv;
44882 arg_conv.inner = untag_ptr(arg);
44883 arg_conv.is_owned = ptr_is_owned(arg);
44884 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
44885 arg_conv.is_owned = false;
44886 int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv);
44890 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) {
44891 LDKChannelTypeFeatures orig_conv;
44892 orig_conv.inner = untag_ptr(orig);
44893 orig_conv.is_owned = ptr_is_owned(orig);
44894 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
44895 orig_conv.is_owned = false;
44896 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv);
44897 int64_t ret_ref = 0;
44898 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44899 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44903 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44904 LDKInitFeatures this_obj_conv;
44905 this_obj_conv.inner = untag_ptr(this_obj);
44906 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44907 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44908 InitFeatures_free(this_obj_conv);
44911 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44912 LDKNodeFeatures this_obj_conv;
44913 this_obj_conv.inner = untag_ptr(this_obj);
44914 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44915 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44916 NodeFeatures_free(this_obj_conv);
44919 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44920 LDKChannelFeatures this_obj_conv;
44921 this_obj_conv.inner = untag_ptr(this_obj);
44922 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44923 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44924 ChannelFeatures_free(this_obj_conv);
44927 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44928 LDKInvoiceFeatures this_obj_conv;
44929 this_obj_conv.inner = untag_ptr(this_obj);
44930 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44931 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44932 InvoiceFeatures_free(this_obj_conv);
44935 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44936 LDKOfferFeatures this_obj_conv;
44937 this_obj_conv.inner = untag_ptr(this_obj);
44938 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44939 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44940 OfferFeatures_free(this_obj_conv);
44943 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44944 LDKInvoiceRequestFeatures this_obj_conv;
44945 this_obj_conv.inner = untag_ptr(this_obj);
44946 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44947 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44948 InvoiceRequestFeatures_free(this_obj_conv);
44951 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44952 LDKBolt12InvoiceFeatures this_obj_conv;
44953 this_obj_conv.inner = untag_ptr(this_obj);
44954 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44955 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44956 Bolt12InvoiceFeatures_free(this_obj_conv);
44959 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44960 LDKBlindedHopFeatures this_obj_conv;
44961 this_obj_conv.inner = untag_ptr(this_obj);
44962 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44963 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44964 BlindedHopFeatures_free(this_obj_conv);
44967 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
44968 LDKChannelTypeFeatures this_obj_conv;
44969 this_obj_conv.inner = untag_ptr(this_obj);
44970 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44971 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44972 ChannelTypeFeatures_free(this_obj_conv);
44975 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv *env, jclass clz) {
44976 LDKInitFeatures ret_var = InitFeatures_empty();
44977 int64_t ret_ref = 0;
44978 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44979 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44983 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
44984 LDKInitFeatures this_arg_conv;
44985 this_arg_conv.inner = untag_ptr(this_arg);
44986 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44987 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44988 this_arg_conv.is_owned = false;
44989 jboolean ret_conv = InitFeatures_requires_unknown_bits(&this_arg_conv);
44993 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty(JNIEnv *env, jclass clz) {
44994 LDKNodeFeatures ret_var = NodeFeatures_empty();
44995 int64_t ret_ref = 0;
44996 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44997 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45001 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
45002 LDKNodeFeatures this_arg_conv;
45003 this_arg_conv.inner = untag_ptr(this_arg);
45004 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45005 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45006 this_arg_conv.is_owned = false;
45007 jboolean ret_conv = NodeFeatures_requires_unknown_bits(&this_arg_conv);
45011 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty(JNIEnv *env, jclass clz) {
45012 LDKChannelFeatures ret_var = ChannelFeatures_empty();
45013 int64_t ret_ref = 0;
45014 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45015 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45019 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
45020 LDKChannelFeatures this_arg_conv;
45021 this_arg_conv.inner = untag_ptr(this_arg);
45022 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45023 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45024 this_arg_conv.is_owned = false;
45025 jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv);
45029 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty(JNIEnv *env, jclass clz) {
45030 LDKInvoiceFeatures ret_var = InvoiceFeatures_empty();
45031 int64_t ret_ref = 0;
45032 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45033 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45037 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
45038 LDKInvoiceFeatures this_arg_conv;
45039 this_arg_conv.inner = untag_ptr(this_arg);
45040 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45041 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45042 this_arg_conv.is_owned = false;
45043 jboolean ret_conv = InvoiceFeatures_requires_unknown_bits(&this_arg_conv);
45047 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1empty(JNIEnv *env, jclass clz) {
45048 LDKOfferFeatures ret_var = OfferFeatures_empty();
45049 int64_t ret_ref = 0;
45050 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45051 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45055 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
45056 LDKOfferFeatures this_arg_conv;
45057 this_arg_conv.inner = untag_ptr(this_arg);
45058 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45059 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45060 this_arg_conv.is_owned = false;
45061 jboolean ret_conv = OfferFeatures_requires_unknown_bits(&this_arg_conv);
45065 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1empty(JNIEnv *env, jclass clz) {
45066 LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_empty();
45067 int64_t ret_ref = 0;
45068 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45069 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45073 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
45074 LDKInvoiceRequestFeatures this_arg_conv;
45075 this_arg_conv.inner = untag_ptr(this_arg);
45076 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45077 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45078 this_arg_conv.is_owned = false;
45079 jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits(&this_arg_conv);
45083 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1empty(JNIEnv *env, jclass clz) {
45084 LDKBolt12InvoiceFeatures ret_var = Bolt12InvoiceFeatures_empty();
45085 int64_t ret_ref = 0;
45086 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45087 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45091 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
45092 LDKBolt12InvoiceFeatures this_arg_conv;
45093 this_arg_conv.inner = untag_ptr(this_arg);
45094 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45095 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45096 this_arg_conv.is_owned = false;
45097 jboolean ret_conv = Bolt12InvoiceFeatures_requires_unknown_bits(&this_arg_conv);
45101 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1empty(JNIEnv *env, jclass clz) {
45102 LDKBlindedHopFeatures ret_var = BlindedHopFeatures_empty();
45103 int64_t ret_ref = 0;
45104 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45105 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45109 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
45110 LDKBlindedHopFeatures this_arg_conv;
45111 this_arg_conv.inner = untag_ptr(this_arg);
45112 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45113 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45114 this_arg_conv.is_owned = false;
45115 jboolean ret_conv = BlindedHopFeatures_requires_unknown_bits(&this_arg_conv);
45119 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty(JNIEnv *env, jclass clz) {
45120 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty();
45121 int64_t ret_ref = 0;
45122 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
45123 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
45127 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
45128 LDKChannelTypeFeatures this_arg_conv;
45129 this_arg_conv.inner = untag_ptr(this_arg);
45130 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45131 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45132 this_arg_conv.is_owned = false;
45133 jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv);
45137 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InitFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
45138 LDKInitFeatures obj_conv;
45139 obj_conv.inner = untag_ptr(obj);
45140 obj_conv.is_owned = ptr_is_owned(obj);
45141 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
45142 obj_conv.is_owned = false;
45143 LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv);
45144 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
45145 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
45146 CVec_u8Z_free(ret_var);
45150 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
45151 LDKu8slice ser_ref;
45152 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
45153 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
45154 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
45155 *ret_conv = InitFeatures_read(ser_ref);
45156 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
45157 return tag_ptr(ret_conv, true);
45160 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
45161 LDKChannelFeatures obj_conv;
45162 obj_conv.inner = untag_ptr(obj);
45163 obj_conv.is_owned = ptr_is_owned(obj);
45164 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
45165 obj_conv.is_owned = false;
45166 LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv);
45167 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
45168 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
45169 CVec_u8Z_free(ret_var);
45173 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
45174 LDKu8slice ser_ref;
45175 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
45176 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
45177 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
45178 *ret_conv = ChannelFeatures_read(ser_ref);
45179 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
45180 return tag_ptr(ret_conv, true);
45183 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
45184 LDKNodeFeatures obj_conv;
45185 obj_conv.inner = untag_ptr(obj);
45186 obj_conv.is_owned = ptr_is_owned(obj);
45187 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
45188 obj_conv.is_owned = false;
45189 LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
45190 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
45191 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
45192 CVec_u8Z_free(ret_var);
45196 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
45197 LDKu8slice ser_ref;
45198 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
45199 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
45200 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
45201 *ret_conv = NodeFeatures_read(ser_ref);
45202 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
45203 return tag_ptr(ret_conv, true);
45206 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
45207 LDKInvoiceFeatures obj_conv;
45208 obj_conv.inner = untag_ptr(obj);
45209 obj_conv.is_owned = ptr_is_owned(obj);
45210 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
45211 obj_conv.is_owned = false;
45212 LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
45213 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
45214 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
45215 CVec_u8Z_free(ret_var);
45219 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
45220 LDKu8slice ser_ref;
45221 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
45222 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
45223 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
45224 *ret_conv = InvoiceFeatures_read(ser_ref);
45225 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
45226 return tag_ptr(ret_conv, true);
45229 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
45230 LDKBlindedHopFeatures obj_conv;
45231 obj_conv.inner = untag_ptr(obj);
45232 obj_conv.is_owned = ptr_is_owned(obj);
45233 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
45234 obj_conv.is_owned = false;
45235 LDKCVec_u8Z ret_var = BlindedHopFeatures_write(&obj_conv);
45236 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
45237 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
45238 CVec_u8Z_free(ret_var);
45242 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHopFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
45243 LDKu8slice ser_ref;
45244 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
45245 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
45246 LDKCResult_BlindedHopFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopFeaturesDecodeErrorZ), "LDKCResult_BlindedHopFeaturesDecodeErrorZ");
45247 *ret_conv = BlindedHopFeatures_read(ser_ref);
45248 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
45249 return tag_ptr(ret_conv, true);
45252 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) {
45253 LDKChannelTypeFeatures obj_conv;
45254 obj_conv.inner = untag_ptr(obj);
45255 obj_conv.is_owned = ptr_is_owned(obj);
45256 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
45257 obj_conv.is_owned = false;
45258 LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv);
45259 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
45260 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
45261 CVec_u8Z_free(ret_var);
45265 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
45266 LDKu8slice ser_ref;
45267 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
45268 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
45269 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
45270 *ret_conv = ChannelTypeFeatures_read(ser_ref);
45271 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
45272 return tag_ptr(ret_conv, true);
45275 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45276 LDKInitFeatures this_arg_conv;
45277 this_arg_conv.inner = untag_ptr(this_arg);
45278 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45279 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45280 this_arg_conv.is_owned = false;
45281 InitFeatures_set_data_loss_protect_optional(&this_arg_conv);
45284 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45285 LDKInitFeatures this_arg_conv;
45286 this_arg_conv.inner = untag_ptr(this_arg);
45287 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45288 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45289 this_arg_conv.is_owned = false;
45290 InitFeatures_set_data_loss_protect_required(&this_arg_conv);
45293 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) {
45294 LDKInitFeatures this_arg_conv;
45295 this_arg_conv.inner = untag_ptr(this_arg);
45296 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45297 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45298 this_arg_conv.is_owned = false;
45299 jboolean ret_conv = InitFeatures_supports_data_loss_protect(&this_arg_conv);
45303 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45304 LDKNodeFeatures this_arg_conv;
45305 this_arg_conv.inner = untag_ptr(this_arg);
45306 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45307 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45308 this_arg_conv.is_owned = false;
45309 NodeFeatures_set_data_loss_protect_optional(&this_arg_conv);
45312 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1data_1loss_1protect_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45313 LDKNodeFeatures this_arg_conv;
45314 this_arg_conv.inner = untag_ptr(this_arg);
45315 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45316 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45317 this_arg_conv.is_owned = false;
45318 NodeFeatures_set_data_loss_protect_required(&this_arg_conv);
45321 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) {
45322 LDKNodeFeatures this_arg_conv;
45323 this_arg_conv.inner = untag_ptr(this_arg);
45324 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45325 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45326 this_arg_conv.is_owned = false;
45327 jboolean ret_conv = NodeFeatures_supports_data_loss_protect(&this_arg_conv);
45331 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) {
45332 LDKInitFeatures this_arg_conv;
45333 this_arg_conv.inner = untag_ptr(this_arg);
45334 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45335 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45336 this_arg_conv.is_owned = false;
45337 jboolean ret_conv = InitFeatures_requires_data_loss_protect(&this_arg_conv);
45341 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1data_1loss_1protect(JNIEnv *env, jclass clz, int64_t this_arg) {
45342 LDKNodeFeatures this_arg_conv;
45343 this_arg_conv.inner = untag_ptr(this_arg);
45344 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45345 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45346 this_arg_conv.is_owned = false;
45347 jboolean ret_conv = NodeFeatures_requires_data_loss_protect(&this_arg_conv);
45351 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45352 LDKInitFeatures this_arg_conv;
45353 this_arg_conv.inner = untag_ptr(this_arg);
45354 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45355 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45356 this_arg_conv.is_owned = false;
45357 InitFeatures_set_initial_routing_sync_optional(&this_arg_conv);
45360 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1initial_1routing_1sync_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45361 LDKInitFeatures this_arg_conv;
45362 this_arg_conv.inner = untag_ptr(this_arg);
45363 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45364 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45365 this_arg_conv.is_owned = false;
45366 InitFeatures_set_initial_routing_sync_required(&this_arg_conv);
45369 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1initial_1routing_1sync(JNIEnv *env, jclass clz, int64_t this_arg) {
45370 LDKInitFeatures this_arg_conv;
45371 this_arg_conv.inner = untag_ptr(this_arg);
45372 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45373 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45374 this_arg_conv.is_owned = false;
45375 jboolean ret_conv = InitFeatures_initial_routing_sync(&this_arg_conv);
45379 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45380 LDKInitFeatures this_arg_conv;
45381 this_arg_conv.inner = untag_ptr(this_arg);
45382 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45383 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45384 this_arg_conv.is_owned = false;
45385 InitFeatures_set_upfront_shutdown_script_optional(&this_arg_conv);
45388 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45389 LDKInitFeatures this_arg_conv;
45390 this_arg_conv.inner = untag_ptr(this_arg);
45391 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45392 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45393 this_arg_conv.is_owned = false;
45394 InitFeatures_set_upfront_shutdown_script_required(&this_arg_conv);
45397 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
45398 LDKInitFeatures this_arg_conv;
45399 this_arg_conv.inner = untag_ptr(this_arg);
45400 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45401 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45402 this_arg_conv.is_owned = false;
45403 jboolean ret_conv = InitFeatures_supports_upfront_shutdown_script(&this_arg_conv);
45407 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45408 LDKNodeFeatures this_arg_conv;
45409 this_arg_conv.inner = untag_ptr(this_arg);
45410 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45411 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45412 this_arg_conv.is_owned = false;
45413 NodeFeatures_set_upfront_shutdown_script_optional(&this_arg_conv);
45416 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1upfront_1shutdown_1script_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45417 LDKNodeFeatures this_arg_conv;
45418 this_arg_conv.inner = untag_ptr(this_arg);
45419 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45420 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45421 this_arg_conv.is_owned = false;
45422 NodeFeatures_set_upfront_shutdown_script_required(&this_arg_conv);
45425 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
45426 LDKNodeFeatures this_arg_conv;
45427 this_arg_conv.inner = untag_ptr(this_arg);
45428 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45429 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45430 this_arg_conv.is_owned = false;
45431 jboolean ret_conv = NodeFeatures_supports_upfront_shutdown_script(&this_arg_conv);
45435 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
45436 LDKInitFeatures this_arg_conv;
45437 this_arg_conv.inner = untag_ptr(this_arg);
45438 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45439 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45440 this_arg_conv.is_owned = false;
45441 jboolean ret_conv = InitFeatures_requires_upfront_shutdown_script(&this_arg_conv);
45445 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1upfront_1shutdown_1script(JNIEnv *env, jclass clz, int64_t this_arg) {
45446 LDKNodeFeatures this_arg_conv;
45447 this_arg_conv.inner = untag_ptr(this_arg);
45448 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45449 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45450 this_arg_conv.is_owned = false;
45451 jboolean ret_conv = NodeFeatures_requires_upfront_shutdown_script(&this_arg_conv);
45455 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45456 LDKInitFeatures this_arg_conv;
45457 this_arg_conv.inner = untag_ptr(this_arg);
45458 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45459 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45460 this_arg_conv.is_owned = false;
45461 InitFeatures_set_gossip_queries_optional(&this_arg_conv);
45464 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45465 LDKInitFeatures this_arg_conv;
45466 this_arg_conv.inner = untag_ptr(this_arg);
45467 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45468 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45469 this_arg_conv.is_owned = false;
45470 InitFeatures_set_gossip_queries_required(&this_arg_conv);
45473 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) {
45474 LDKInitFeatures this_arg_conv;
45475 this_arg_conv.inner = untag_ptr(this_arg);
45476 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45477 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45478 this_arg_conv.is_owned = false;
45479 jboolean ret_conv = InitFeatures_supports_gossip_queries(&this_arg_conv);
45483 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45484 LDKNodeFeatures this_arg_conv;
45485 this_arg_conv.inner = untag_ptr(this_arg);
45486 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45487 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45488 this_arg_conv.is_owned = false;
45489 NodeFeatures_set_gossip_queries_optional(&this_arg_conv);
45492 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1gossip_1queries_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45493 LDKNodeFeatures this_arg_conv;
45494 this_arg_conv.inner = untag_ptr(this_arg);
45495 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45496 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45497 this_arg_conv.is_owned = false;
45498 NodeFeatures_set_gossip_queries_required(&this_arg_conv);
45501 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) {
45502 LDKNodeFeatures this_arg_conv;
45503 this_arg_conv.inner = untag_ptr(this_arg);
45504 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45505 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45506 this_arg_conv.is_owned = false;
45507 jboolean ret_conv = NodeFeatures_supports_gossip_queries(&this_arg_conv);
45511 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) {
45512 LDKInitFeatures this_arg_conv;
45513 this_arg_conv.inner = untag_ptr(this_arg);
45514 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45515 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45516 this_arg_conv.is_owned = false;
45517 jboolean ret_conv = InitFeatures_requires_gossip_queries(&this_arg_conv);
45521 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1gossip_1queries(JNIEnv *env, jclass clz, int64_t this_arg) {
45522 LDKNodeFeatures this_arg_conv;
45523 this_arg_conv.inner = untag_ptr(this_arg);
45524 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45525 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45526 this_arg_conv.is_owned = false;
45527 jboolean ret_conv = NodeFeatures_requires_gossip_queries(&this_arg_conv);
45531 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45532 LDKInitFeatures this_arg_conv;
45533 this_arg_conv.inner = untag_ptr(this_arg);
45534 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45535 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45536 this_arg_conv.is_owned = false;
45537 InitFeatures_set_variable_length_onion_optional(&this_arg_conv);
45540 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45541 LDKInitFeatures this_arg_conv;
45542 this_arg_conv.inner = untag_ptr(this_arg);
45543 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45544 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45545 this_arg_conv.is_owned = false;
45546 InitFeatures_set_variable_length_onion_required(&this_arg_conv);
45549 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
45550 LDKInitFeatures this_arg_conv;
45551 this_arg_conv.inner = untag_ptr(this_arg);
45552 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45553 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45554 this_arg_conv.is_owned = false;
45555 jboolean ret_conv = InitFeatures_supports_variable_length_onion(&this_arg_conv);
45559 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45560 LDKNodeFeatures this_arg_conv;
45561 this_arg_conv.inner = untag_ptr(this_arg);
45562 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45563 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45564 this_arg_conv.is_owned = false;
45565 NodeFeatures_set_variable_length_onion_optional(&this_arg_conv);
45568 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45569 LDKNodeFeatures this_arg_conv;
45570 this_arg_conv.inner = untag_ptr(this_arg);
45571 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45572 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45573 this_arg_conv.is_owned = false;
45574 NodeFeatures_set_variable_length_onion_required(&this_arg_conv);
45577 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
45578 LDKNodeFeatures this_arg_conv;
45579 this_arg_conv.inner = untag_ptr(this_arg);
45580 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45581 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45582 this_arg_conv.is_owned = false;
45583 jboolean ret_conv = NodeFeatures_supports_variable_length_onion(&this_arg_conv);
45587 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1variable_1length_1onion_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45588 LDKInvoiceFeatures this_arg_conv;
45589 this_arg_conv.inner = untag_ptr(this_arg);
45590 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45591 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45592 this_arg_conv.is_owned = false;
45593 InvoiceFeatures_set_variable_length_onion_optional(&this_arg_conv);
45596 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1variable_1length_1onion_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45597 LDKInvoiceFeatures this_arg_conv;
45598 this_arg_conv.inner = untag_ptr(this_arg);
45599 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45600 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45601 this_arg_conv.is_owned = false;
45602 InvoiceFeatures_set_variable_length_onion_required(&this_arg_conv);
45605 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
45606 LDKInvoiceFeatures this_arg_conv;
45607 this_arg_conv.inner = untag_ptr(this_arg);
45608 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45609 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45610 this_arg_conv.is_owned = false;
45611 jboolean ret_conv = InvoiceFeatures_supports_variable_length_onion(&this_arg_conv);
45615 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
45616 LDKInitFeatures this_arg_conv;
45617 this_arg_conv.inner = untag_ptr(this_arg);
45618 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45619 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45620 this_arg_conv.is_owned = false;
45621 jboolean ret_conv = InitFeatures_requires_variable_length_onion(&this_arg_conv);
45625 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
45626 LDKNodeFeatures this_arg_conv;
45627 this_arg_conv.inner = untag_ptr(this_arg);
45628 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45629 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45630 this_arg_conv.is_owned = false;
45631 jboolean ret_conv = NodeFeatures_requires_variable_length_onion(&this_arg_conv);
45635 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1variable_1length_1onion(JNIEnv *env, jclass clz, int64_t this_arg) {
45636 LDKInvoiceFeatures this_arg_conv;
45637 this_arg_conv.inner = untag_ptr(this_arg);
45638 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45639 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45640 this_arg_conv.is_owned = false;
45641 jboolean ret_conv = InvoiceFeatures_requires_variable_length_onion(&this_arg_conv);
45645 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45646 LDKInitFeatures this_arg_conv;
45647 this_arg_conv.inner = untag_ptr(this_arg);
45648 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45649 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45650 this_arg_conv.is_owned = false;
45651 InitFeatures_set_static_remote_key_optional(&this_arg_conv);
45654 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45655 LDKInitFeatures this_arg_conv;
45656 this_arg_conv.inner = untag_ptr(this_arg);
45657 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45658 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45659 this_arg_conv.is_owned = false;
45660 InitFeatures_set_static_remote_key_required(&this_arg_conv);
45663 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
45664 LDKInitFeatures this_arg_conv;
45665 this_arg_conv.inner = untag_ptr(this_arg);
45666 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45667 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45668 this_arg_conv.is_owned = false;
45669 jboolean ret_conv = InitFeatures_supports_static_remote_key(&this_arg_conv);
45673 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45674 LDKNodeFeatures this_arg_conv;
45675 this_arg_conv.inner = untag_ptr(this_arg);
45676 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45677 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45678 this_arg_conv.is_owned = false;
45679 NodeFeatures_set_static_remote_key_optional(&this_arg_conv);
45682 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45683 LDKNodeFeatures this_arg_conv;
45684 this_arg_conv.inner = untag_ptr(this_arg);
45685 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45686 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45687 this_arg_conv.is_owned = false;
45688 NodeFeatures_set_static_remote_key_required(&this_arg_conv);
45691 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
45692 LDKNodeFeatures this_arg_conv;
45693 this_arg_conv.inner = untag_ptr(this_arg);
45694 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45695 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45696 this_arg_conv.is_owned = false;
45697 jboolean ret_conv = NodeFeatures_supports_static_remote_key(&this_arg_conv);
45701 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45702 LDKChannelTypeFeatures this_arg_conv;
45703 this_arg_conv.inner = untag_ptr(this_arg);
45704 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45705 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45706 this_arg_conv.is_owned = false;
45707 ChannelTypeFeatures_set_static_remote_key_optional(&this_arg_conv);
45710 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1static_1remote_1key_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45711 LDKChannelTypeFeatures this_arg_conv;
45712 this_arg_conv.inner = untag_ptr(this_arg);
45713 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45714 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45715 this_arg_conv.is_owned = false;
45716 ChannelTypeFeatures_set_static_remote_key_required(&this_arg_conv);
45719 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
45720 LDKChannelTypeFeatures this_arg_conv;
45721 this_arg_conv.inner = untag_ptr(this_arg);
45722 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45723 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45724 this_arg_conv.is_owned = false;
45725 jboolean ret_conv = ChannelTypeFeatures_supports_static_remote_key(&this_arg_conv);
45729 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
45730 LDKInitFeatures this_arg_conv;
45731 this_arg_conv.inner = untag_ptr(this_arg);
45732 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45733 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45734 this_arg_conv.is_owned = false;
45735 jboolean ret_conv = InitFeatures_requires_static_remote_key(&this_arg_conv);
45739 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
45740 LDKNodeFeatures this_arg_conv;
45741 this_arg_conv.inner = untag_ptr(this_arg);
45742 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45743 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45744 this_arg_conv.is_owned = false;
45745 jboolean ret_conv = NodeFeatures_requires_static_remote_key(&this_arg_conv);
45749 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1static_1remote_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
45750 LDKChannelTypeFeatures this_arg_conv;
45751 this_arg_conv.inner = untag_ptr(this_arg);
45752 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45753 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45754 this_arg_conv.is_owned = false;
45755 jboolean ret_conv = ChannelTypeFeatures_requires_static_remote_key(&this_arg_conv);
45759 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45760 LDKInitFeatures this_arg_conv;
45761 this_arg_conv.inner = untag_ptr(this_arg);
45762 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45763 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45764 this_arg_conv.is_owned = false;
45765 InitFeatures_set_payment_secret_optional(&this_arg_conv);
45768 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45769 LDKInitFeatures this_arg_conv;
45770 this_arg_conv.inner = untag_ptr(this_arg);
45771 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45772 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45773 this_arg_conv.is_owned = false;
45774 InitFeatures_set_payment_secret_required(&this_arg_conv);
45777 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
45778 LDKInitFeatures this_arg_conv;
45779 this_arg_conv.inner = untag_ptr(this_arg);
45780 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45781 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45782 this_arg_conv.is_owned = false;
45783 jboolean ret_conv = InitFeatures_supports_payment_secret(&this_arg_conv);
45787 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45788 LDKNodeFeatures this_arg_conv;
45789 this_arg_conv.inner = untag_ptr(this_arg);
45790 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45791 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45792 this_arg_conv.is_owned = false;
45793 NodeFeatures_set_payment_secret_optional(&this_arg_conv);
45796 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45797 LDKNodeFeatures this_arg_conv;
45798 this_arg_conv.inner = untag_ptr(this_arg);
45799 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45800 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45801 this_arg_conv.is_owned = false;
45802 NodeFeatures_set_payment_secret_required(&this_arg_conv);
45805 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
45806 LDKNodeFeatures this_arg_conv;
45807 this_arg_conv.inner = untag_ptr(this_arg);
45808 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45809 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45810 this_arg_conv.is_owned = false;
45811 jboolean ret_conv = NodeFeatures_supports_payment_secret(&this_arg_conv);
45815 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1payment_1secret_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45816 LDKInvoiceFeatures this_arg_conv;
45817 this_arg_conv.inner = untag_ptr(this_arg);
45818 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45819 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45820 this_arg_conv.is_owned = false;
45821 InvoiceFeatures_set_payment_secret_optional(&this_arg_conv);
45824 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1payment_1secret_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45825 LDKInvoiceFeatures this_arg_conv;
45826 this_arg_conv.inner = untag_ptr(this_arg);
45827 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45828 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45829 this_arg_conv.is_owned = false;
45830 InvoiceFeatures_set_payment_secret_required(&this_arg_conv);
45833 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
45834 LDKInvoiceFeatures this_arg_conv;
45835 this_arg_conv.inner = untag_ptr(this_arg);
45836 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45837 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45838 this_arg_conv.is_owned = false;
45839 jboolean ret_conv = InvoiceFeatures_supports_payment_secret(&this_arg_conv);
45843 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
45844 LDKInitFeatures this_arg_conv;
45845 this_arg_conv.inner = untag_ptr(this_arg);
45846 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45847 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45848 this_arg_conv.is_owned = false;
45849 jboolean ret_conv = InitFeatures_requires_payment_secret(&this_arg_conv);
45853 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
45854 LDKNodeFeatures this_arg_conv;
45855 this_arg_conv.inner = untag_ptr(this_arg);
45856 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45857 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45858 this_arg_conv.is_owned = false;
45859 jboolean ret_conv = NodeFeatures_requires_payment_secret(&this_arg_conv);
45863 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
45864 LDKInvoiceFeatures this_arg_conv;
45865 this_arg_conv.inner = untag_ptr(this_arg);
45866 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45867 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45868 this_arg_conv.is_owned = false;
45869 jboolean ret_conv = InvoiceFeatures_requires_payment_secret(&this_arg_conv);
45873 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45874 LDKInitFeatures this_arg_conv;
45875 this_arg_conv.inner = untag_ptr(this_arg);
45876 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45877 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45878 this_arg_conv.is_owned = false;
45879 InitFeatures_set_basic_mpp_optional(&this_arg_conv);
45882 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45883 LDKInitFeatures this_arg_conv;
45884 this_arg_conv.inner = untag_ptr(this_arg);
45885 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45886 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45887 this_arg_conv.is_owned = false;
45888 InitFeatures_set_basic_mpp_required(&this_arg_conv);
45891 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
45892 LDKInitFeatures this_arg_conv;
45893 this_arg_conv.inner = untag_ptr(this_arg);
45894 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45895 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45896 this_arg_conv.is_owned = false;
45897 jboolean ret_conv = InitFeatures_supports_basic_mpp(&this_arg_conv);
45901 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45902 LDKNodeFeatures this_arg_conv;
45903 this_arg_conv.inner = untag_ptr(this_arg);
45904 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45905 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45906 this_arg_conv.is_owned = false;
45907 NodeFeatures_set_basic_mpp_optional(&this_arg_conv);
45910 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45911 LDKNodeFeatures this_arg_conv;
45912 this_arg_conv.inner = untag_ptr(this_arg);
45913 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45914 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45915 this_arg_conv.is_owned = false;
45916 NodeFeatures_set_basic_mpp_required(&this_arg_conv);
45919 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
45920 LDKNodeFeatures this_arg_conv;
45921 this_arg_conv.inner = untag_ptr(this_arg);
45922 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45923 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45924 this_arg_conv.is_owned = false;
45925 jboolean ret_conv = NodeFeatures_supports_basic_mpp(&this_arg_conv);
45929 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45930 LDKInvoiceFeatures this_arg_conv;
45931 this_arg_conv.inner = untag_ptr(this_arg);
45932 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45933 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45934 this_arg_conv.is_owned = false;
45935 InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv);
45938 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45939 LDKInvoiceFeatures this_arg_conv;
45940 this_arg_conv.inner = untag_ptr(this_arg);
45941 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45942 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45943 this_arg_conv.is_owned = false;
45944 InvoiceFeatures_set_basic_mpp_required(&this_arg_conv);
45947 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
45948 LDKInvoiceFeatures this_arg_conv;
45949 this_arg_conv.inner = untag_ptr(this_arg);
45950 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45951 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45952 this_arg_conv.is_owned = false;
45953 jboolean ret_conv = InvoiceFeatures_supports_basic_mpp(&this_arg_conv);
45957 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1basic_1mpp_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
45958 LDKBolt12InvoiceFeatures this_arg_conv;
45959 this_arg_conv.inner = untag_ptr(this_arg);
45960 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45961 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45962 this_arg_conv.is_owned = false;
45963 Bolt12InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv);
45966 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1set_1basic_1mpp_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
45967 LDKBolt12InvoiceFeatures this_arg_conv;
45968 this_arg_conv.inner = untag_ptr(this_arg);
45969 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45970 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45971 this_arg_conv.is_owned = false;
45972 Bolt12InvoiceFeatures_set_basic_mpp_required(&this_arg_conv);
45975 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1supports_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
45976 LDKBolt12InvoiceFeatures this_arg_conv;
45977 this_arg_conv.inner = untag_ptr(this_arg);
45978 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45979 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45980 this_arg_conv.is_owned = false;
45981 jboolean ret_conv = Bolt12InvoiceFeatures_supports_basic_mpp(&this_arg_conv);
45985 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
45986 LDKInitFeatures this_arg_conv;
45987 this_arg_conv.inner = untag_ptr(this_arg);
45988 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45989 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
45990 this_arg_conv.is_owned = false;
45991 jboolean ret_conv = InitFeatures_requires_basic_mpp(&this_arg_conv);
45995 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
45996 LDKNodeFeatures this_arg_conv;
45997 this_arg_conv.inner = untag_ptr(this_arg);
45998 this_arg_conv.is_owned = ptr_is_owned(this_arg);
45999 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46000 this_arg_conv.is_owned = false;
46001 jboolean ret_conv = NodeFeatures_requires_basic_mpp(&this_arg_conv);
46005 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
46006 LDKInvoiceFeatures this_arg_conv;
46007 this_arg_conv.inner = untag_ptr(this_arg);
46008 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46009 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46010 this_arg_conv.is_owned = false;
46011 jboolean ret_conv = InvoiceFeatures_requires_basic_mpp(&this_arg_conv);
46015 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Bolt12InvoiceFeatures_1requires_1basic_1mpp(JNIEnv *env, jclass clz, int64_t this_arg) {
46016 LDKBolt12InvoiceFeatures this_arg_conv;
46017 this_arg_conv.inner = untag_ptr(this_arg);
46018 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46019 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46020 this_arg_conv.is_owned = false;
46021 jboolean ret_conv = Bolt12InvoiceFeatures_requires_basic_mpp(&this_arg_conv);
46025 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46026 LDKInitFeatures this_arg_conv;
46027 this_arg_conv.inner = untag_ptr(this_arg);
46028 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46029 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46030 this_arg_conv.is_owned = false;
46031 InitFeatures_set_wumbo_optional(&this_arg_conv);
46034 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46035 LDKInitFeatures this_arg_conv;
46036 this_arg_conv.inner = untag_ptr(this_arg);
46037 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46038 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46039 this_arg_conv.is_owned = false;
46040 InitFeatures_set_wumbo_required(&this_arg_conv);
46043 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) {
46044 LDKInitFeatures this_arg_conv;
46045 this_arg_conv.inner = untag_ptr(this_arg);
46046 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46047 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46048 this_arg_conv.is_owned = false;
46049 jboolean ret_conv = InitFeatures_supports_wumbo(&this_arg_conv);
46053 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46054 LDKNodeFeatures this_arg_conv;
46055 this_arg_conv.inner = untag_ptr(this_arg);
46056 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46057 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46058 this_arg_conv.is_owned = false;
46059 NodeFeatures_set_wumbo_optional(&this_arg_conv);
46062 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1wumbo_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46063 LDKNodeFeatures this_arg_conv;
46064 this_arg_conv.inner = untag_ptr(this_arg);
46065 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46066 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46067 this_arg_conv.is_owned = false;
46068 NodeFeatures_set_wumbo_required(&this_arg_conv);
46071 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) {
46072 LDKNodeFeatures this_arg_conv;
46073 this_arg_conv.inner = untag_ptr(this_arg);
46074 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46075 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46076 this_arg_conv.is_owned = false;
46077 jboolean ret_conv = NodeFeatures_supports_wumbo(&this_arg_conv);
46081 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) {
46082 LDKInitFeatures this_arg_conv;
46083 this_arg_conv.inner = untag_ptr(this_arg);
46084 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46085 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46086 this_arg_conv.is_owned = false;
46087 jboolean ret_conv = InitFeatures_requires_wumbo(&this_arg_conv);
46091 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1wumbo(JNIEnv *env, jclass clz, int64_t this_arg) {
46092 LDKNodeFeatures this_arg_conv;
46093 this_arg_conv.inner = untag_ptr(this_arg);
46094 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46095 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46096 this_arg_conv.is_owned = false;
46097 jboolean ret_conv = NodeFeatures_requires_wumbo(&this_arg_conv);
46101 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46102 LDKInitFeatures this_arg_conv;
46103 this_arg_conv.inner = untag_ptr(this_arg);
46104 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46105 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46106 this_arg_conv.is_owned = false;
46107 InitFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv);
46110 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46111 LDKInitFeatures this_arg_conv;
46112 this_arg_conv.inner = untag_ptr(this_arg);
46113 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46114 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46115 this_arg_conv.is_owned = false;
46116 InitFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv);
46119 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) {
46120 LDKInitFeatures this_arg_conv;
46121 this_arg_conv.inner = untag_ptr(this_arg);
46122 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46123 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46124 this_arg_conv.is_owned = false;
46125 jboolean ret_conv = InitFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv);
46129 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46130 LDKNodeFeatures this_arg_conv;
46131 this_arg_conv.inner = untag_ptr(this_arg);
46132 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46133 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46134 this_arg_conv.is_owned = false;
46135 NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv);
46138 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46139 LDKNodeFeatures this_arg_conv;
46140 this_arg_conv.inner = untag_ptr(this_arg);
46141 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46142 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46143 this_arg_conv.is_owned = false;
46144 NodeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv);
46147 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) {
46148 LDKNodeFeatures this_arg_conv;
46149 this_arg_conv.inner = untag_ptr(this_arg);
46150 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46151 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46152 this_arg_conv.is_owned = false;
46153 jboolean ret_conv = NodeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv);
46157 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46158 LDKChannelTypeFeatures this_arg_conv;
46159 this_arg_conv.inner = untag_ptr(this_arg);
46160 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46161 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46162 this_arg_conv.is_owned = false;
46163 ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(&this_arg_conv);
46166 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1anchors_1zero_1fee_1htlc_1tx_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46167 LDKChannelTypeFeatures this_arg_conv;
46168 this_arg_conv.inner = untag_ptr(this_arg);
46169 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46170 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46171 this_arg_conv.is_owned = false;
46172 ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(&this_arg_conv);
46175 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) {
46176 LDKChannelTypeFeatures this_arg_conv;
46177 this_arg_conv.inner = untag_ptr(this_arg);
46178 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46179 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46180 this_arg_conv.is_owned = false;
46181 jboolean ret_conv = ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(&this_arg_conv);
46185 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) {
46186 LDKInitFeatures this_arg_conv;
46187 this_arg_conv.inner = untag_ptr(this_arg);
46188 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46189 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46190 this_arg_conv.is_owned = false;
46191 jboolean ret_conv = InitFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv);
46195 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) {
46196 LDKNodeFeatures this_arg_conv;
46197 this_arg_conv.inner = untag_ptr(this_arg);
46198 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46199 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46200 this_arg_conv.is_owned = false;
46201 jboolean ret_conv = NodeFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv);
46205 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1anchors_1zero_1fee_1htlc_1tx(JNIEnv *env, jclass clz, int64_t this_arg) {
46206 LDKChannelTypeFeatures this_arg_conv;
46207 this_arg_conv.inner = untag_ptr(this_arg);
46208 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46209 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46210 this_arg_conv.is_owned = false;
46211 jboolean ret_conv = ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(&this_arg_conv);
46215 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46216 LDKInitFeatures this_arg_conv;
46217 this_arg_conv.inner = untag_ptr(this_arg);
46218 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46219 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46220 this_arg_conv.is_owned = false;
46221 InitFeatures_set_shutdown_any_segwit_optional(&this_arg_conv);
46224 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46225 LDKInitFeatures this_arg_conv;
46226 this_arg_conv.inner = untag_ptr(this_arg);
46227 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46228 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46229 this_arg_conv.is_owned = false;
46230 InitFeatures_set_shutdown_any_segwit_required(&this_arg_conv);
46233 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) {
46234 LDKInitFeatures this_arg_conv;
46235 this_arg_conv.inner = untag_ptr(this_arg);
46236 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46237 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46238 this_arg_conv.is_owned = false;
46239 jboolean ret_conv = InitFeatures_supports_shutdown_anysegwit(&this_arg_conv);
46243 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46244 LDKNodeFeatures this_arg_conv;
46245 this_arg_conv.inner = untag_ptr(this_arg);
46246 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46247 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46248 this_arg_conv.is_owned = false;
46249 NodeFeatures_set_shutdown_any_segwit_optional(&this_arg_conv);
46252 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1shutdown_1any_1segwit_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46253 LDKNodeFeatures this_arg_conv;
46254 this_arg_conv.inner = untag_ptr(this_arg);
46255 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46256 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46257 this_arg_conv.is_owned = false;
46258 NodeFeatures_set_shutdown_any_segwit_required(&this_arg_conv);
46261 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) {
46262 LDKNodeFeatures this_arg_conv;
46263 this_arg_conv.inner = untag_ptr(this_arg);
46264 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46265 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46266 this_arg_conv.is_owned = false;
46267 jboolean ret_conv = NodeFeatures_supports_shutdown_anysegwit(&this_arg_conv);
46271 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) {
46272 LDKInitFeatures this_arg_conv;
46273 this_arg_conv.inner = untag_ptr(this_arg);
46274 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46276 this_arg_conv.is_owned = false;
46277 jboolean ret_conv = InitFeatures_requires_shutdown_anysegwit(&this_arg_conv);
46281 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1shutdown_1anysegwit(JNIEnv *env, jclass clz, int64_t this_arg) {
46282 LDKNodeFeatures this_arg_conv;
46283 this_arg_conv.inner = untag_ptr(this_arg);
46284 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46285 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46286 this_arg_conv.is_owned = false;
46287 jboolean ret_conv = NodeFeatures_requires_shutdown_anysegwit(&this_arg_conv);
46291 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1onion_1messages_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46292 LDKInitFeatures this_arg_conv;
46293 this_arg_conv.inner = untag_ptr(this_arg);
46294 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46296 this_arg_conv.is_owned = false;
46297 InitFeatures_set_onion_messages_optional(&this_arg_conv);
46300 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1onion_1messages_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46301 LDKInitFeatures this_arg_conv;
46302 this_arg_conv.inner = untag_ptr(this_arg);
46303 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46304 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46305 this_arg_conv.is_owned = false;
46306 InitFeatures_set_onion_messages_required(&this_arg_conv);
46309 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) {
46310 LDKInitFeatures this_arg_conv;
46311 this_arg_conv.inner = untag_ptr(this_arg);
46312 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46313 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46314 this_arg_conv.is_owned = false;
46315 jboolean ret_conv = InitFeatures_supports_onion_messages(&this_arg_conv);
46319 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1onion_1messages_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46320 LDKNodeFeatures this_arg_conv;
46321 this_arg_conv.inner = untag_ptr(this_arg);
46322 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46323 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46324 this_arg_conv.is_owned = false;
46325 NodeFeatures_set_onion_messages_optional(&this_arg_conv);
46328 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1onion_1messages_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46329 LDKNodeFeatures this_arg_conv;
46330 this_arg_conv.inner = untag_ptr(this_arg);
46331 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46332 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46333 this_arg_conv.is_owned = false;
46334 NodeFeatures_set_onion_messages_required(&this_arg_conv);
46337 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) {
46338 LDKNodeFeatures this_arg_conv;
46339 this_arg_conv.inner = untag_ptr(this_arg);
46340 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46341 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46342 this_arg_conv.is_owned = false;
46343 jboolean ret_conv = NodeFeatures_supports_onion_messages(&this_arg_conv);
46347 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) {
46348 LDKInitFeatures this_arg_conv;
46349 this_arg_conv.inner = untag_ptr(this_arg);
46350 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46351 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46352 this_arg_conv.is_owned = false;
46353 jboolean ret_conv = InitFeatures_requires_onion_messages(&this_arg_conv);
46357 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1onion_1messages(JNIEnv *env, jclass clz, int64_t this_arg) {
46358 LDKNodeFeatures this_arg_conv;
46359 this_arg_conv.inner = untag_ptr(this_arg);
46360 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46361 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46362 this_arg_conv.is_owned = false;
46363 jboolean ret_conv = NodeFeatures_requires_onion_messages(&this_arg_conv);
46367 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46368 LDKInitFeatures this_arg_conv;
46369 this_arg_conv.inner = untag_ptr(this_arg);
46370 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46371 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46372 this_arg_conv.is_owned = false;
46373 InitFeatures_set_channel_type_optional(&this_arg_conv);
46376 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46377 LDKInitFeatures this_arg_conv;
46378 this_arg_conv.inner = untag_ptr(this_arg);
46379 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46380 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46381 this_arg_conv.is_owned = false;
46382 InitFeatures_set_channel_type_required(&this_arg_conv);
46385 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
46386 LDKInitFeatures this_arg_conv;
46387 this_arg_conv.inner = untag_ptr(this_arg);
46388 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46389 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46390 this_arg_conv.is_owned = false;
46391 jboolean ret_conv = InitFeatures_supports_channel_type(&this_arg_conv);
46395 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46396 LDKNodeFeatures this_arg_conv;
46397 this_arg_conv.inner = untag_ptr(this_arg);
46398 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46399 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46400 this_arg_conv.is_owned = false;
46401 NodeFeatures_set_channel_type_optional(&this_arg_conv);
46404 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1channel_1type_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46405 LDKNodeFeatures this_arg_conv;
46406 this_arg_conv.inner = untag_ptr(this_arg);
46407 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46408 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46409 this_arg_conv.is_owned = false;
46410 NodeFeatures_set_channel_type_required(&this_arg_conv);
46413 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
46414 LDKNodeFeatures this_arg_conv;
46415 this_arg_conv.inner = untag_ptr(this_arg);
46416 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46417 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46418 this_arg_conv.is_owned = false;
46419 jboolean ret_conv = NodeFeatures_supports_channel_type(&this_arg_conv);
46423 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
46424 LDKInitFeatures this_arg_conv;
46425 this_arg_conv.inner = untag_ptr(this_arg);
46426 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46427 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46428 this_arg_conv.is_owned = false;
46429 jboolean ret_conv = InitFeatures_requires_channel_type(&this_arg_conv);
46433 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1channel_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
46434 LDKNodeFeatures this_arg_conv;
46435 this_arg_conv.inner = untag_ptr(this_arg);
46436 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46437 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46438 this_arg_conv.is_owned = false;
46439 jboolean ret_conv = NodeFeatures_requires_channel_type(&this_arg_conv);
46443 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46444 LDKInitFeatures this_arg_conv;
46445 this_arg_conv.inner = untag_ptr(this_arg);
46446 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46447 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46448 this_arg_conv.is_owned = false;
46449 InitFeatures_set_scid_privacy_optional(&this_arg_conv);
46452 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46453 LDKInitFeatures this_arg_conv;
46454 this_arg_conv.inner = untag_ptr(this_arg);
46455 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46456 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46457 this_arg_conv.is_owned = false;
46458 InitFeatures_set_scid_privacy_required(&this_arg_conv);
46461 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
46462 LDKInitFeatures this_arg_conv;
46463 this_arg_conv.inner = untag_ptr(this_arg);
46464 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46465 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46466 this_arg_conv.is_owned = false;
46467 jboolean ret_conv = InitFeatures_supports_scid_privacy(&this_arg_conv);
46471 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46472 LDKNodeFeatures this_arg_conv;
46473 this_arg_conv.inner = untag_ptr(this_arg);
46474 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46475 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46476 this_arg_conv.is_owned = false;
46477 NodeFeatures_set_scid_privacy_optional(&this_arg_conv);
46480 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46481 LDKNodeFeatures this_arg_conv;
46482 this_arg_conv.inner = untag_ptr(this_arg);
46483 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46484 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46485 this_arg_conv.is_owned = false;
46486 NodeFeatures_set_scid_privacy_required(&this_arg_conv);
46489 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
46490 LDKNodeFeatures this_arg_conv;
46491 this_arg_conv.inner = untag_ptr(this_arg);
46492 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46493 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46494 this_arg_conv.is_owned = false;
46495 jboolean ret_conv = NodeFeatures_supports_scid_privacy(&this_arg_conv);
46499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46500 LDKChannelTypeFeatures this_arg_conv;
46501 this_arg_conv.inner = untag_ptr(this_arg);
46502 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46503 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46504 this_arg_conv.is_owned = false;
46505 ChannelTypeFeatures_set_scid_privacy_optional(&this_arg_conv);
46508 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1scid_1privacy_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46509 LDKChannelTypeFeatures this_arg_conv;
46510 this_arg_conv.inner = untag_ptr(this_arg);
46511 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46512 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46513 this_arg_conv.is_owned = false;
46514 ChannelTypeFeatures_set_scid_privacy_required(&this_arg_conv);
46517 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
46518 LDKChannelTypeFeatures this_arg_conv;
46519 this_arg_conv.inner = untag_ptr(this_arg);
46520 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46521 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46522 this_arg_conv.is_owned = false;
46523 jboolean ret_conv = ChannelTypeFeatures_supports_scid_privacy(&this_arg_conv);
46527 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
46528 LDKInitFeatures this_arg_conv;
46529 this_arg_conv.inner = untag_ptr(this_arg);
46530 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46531 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46532 this_arg_conv.is_owned = false;
46533 jboolean ret_conv = InitFeatures_requires_scid_privacy(&this_arg_conv);
46537 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
46538 LDKNodeFeatures this_arg_conv;
46539 this_arg_conv.inner = untag_ptr(this_arg);
46540 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46541 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46542 this_arg_conv.is_owned = false;
46543 jboolean ret_conv = NodeFeatures_requires_scid_privacy(&this_arg_conv);
46547 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1scid_1privacy(JNIEnv *env, jclass clz, int64_t this_arg) {
46548 LDKChannelTypeFeatures this_arg_conv;
46549 this_arg_conv.inner = untag_ptr(this_arg);
46550 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46551 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46552 this_arg_conv.is_owned = false;
46553 jboolean ret_conv = ChannelTypeFeatures_requires_scid_privacy(&this_arg_conv);
46557 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1payment_1metadata_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46558 LDKInvoiceFeatures this_arg_conv;
46559 this_arg_conv.inner = untag_ptr(this_arg);
46560 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46561 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46562 this_arg_conv.is_owned = false;
46563 InvoiceFeatures_set_payment_metadata_optional(&this_arg_conv);
46566 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1set_1payment_1metadata_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46567 LDKInvoiceFeatures this_arg_conv;
46568 this_arg_conv.inner = untag_ptr(this_arg);
46569 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46570 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46571 this_arg_conv.is_owned = false;
46572 InvoiceFeatures_set_payment_metadata_required(&this_arg_conv);
46575 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1supports_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) {
46576 LDKInvoiceFeatures this_arg_conv;
46577 this_arg_conv.inner = untag_ptr(this_arg);
46578 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46579 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46580 this_arg_conv.is_owned = false;
46581 jboolean ret_conv = InvoiceFeatures_supports_payment_metadata(&this_arg_conv);
46585 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) {
46586 LDKInvoiceFeatures this_arg_conv;
46587 this_arg_conv.inner = untag_ptr(this_arg);
46588 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46589 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46590 this_arg_conv.is_owned = false;
46591 jboolean ret_conv = InvoiceFeatures_requires_payment_metadata(&this_arg_conv);
46595 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46596 LDKInitFeatures this_arg_conv;
46597 this_arg_conv.inner = untag_ptr(this_arg);
46598 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46599 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46600 this_arg_conv.is_owned = false;
46601 InitFeatures_set_zero_conf_optional(&this_arg_conv);
46604 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46605 LDKInitFeatures this_arg_conv;
46606 this_arg_conv.inner = untag_ptr(this_arg);
46607 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46608 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46609 this_arg_conv.is_owned = false;
46610 InitFeatures_set_zero_conf_required(&this_arg_conv);
46613 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
46614 LDKInitFeatures this_arg_conv;
46615 this_arg_conv.inner = untag_ptr(this_arg);
46616 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46617 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46618 this_arg_conv.is_owned = false;
46619 jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv);
46623 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46624 LDKNodeFeatures this_arg_conv;
46625 this_arg_conv.inner = untag_ptr(this_arg);
46626 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46627 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46628 this_arg_conv.is_owned = false;
46629 NodeFeatures_set_zero_conf_optional(&this_arg_conv);
46632 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46633 LDKNodeFeatures this_arg_conv;
46634 this_arg_conv.inner = untag_ptr(this_arg);
46635 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46636 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46637 this_arg_conv.is_owned = false;
46638 NodeFeatures_set_zero_conf_required(&this_arg_conv);
46641 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
46642 LDKNodeFeatures this_arg_conv;
46643 this_arg_conv.inner = untag_ptr(this_arg);
46644 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46645 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46646 this_arg_conv.is_owned = false;
46647 jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv);
46651 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46652 LDKChannelTypeFeatures this_arg_conv;
46653 this_arg_conv.inner = untag_ptr(this_arg);
46654 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46655 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46656 this_arg_conv.is_owned = false;
46657 ChannelTypeFeatures_set_zero_conf_optional(&this_arg_conv);
46660 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1set_1zero_1conf_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46661 LDKChannelTypeFeatures this_arg_conv;
46662 this_arg_conv.inner = untag_ptr(this_arg);
46663 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46664 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46665 this_arg_conv.is_owned = false;
46666 ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv);
46669 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1supports_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
46670 LDKChannelTypeFeatures this_arg_conv;
46671 this_arg_conv.inner = untag_ptr(this_arg);
46672 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46673 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46674 this_arg_conv.is_owned = false;
46675 jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv);
46679 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
46680 LDKInitFeatures this_arg_conv;
46681 this_arg_conv.inner = untag_ptr(this_arg);
46682 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46683 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46684 this_arg_conv.is_owned = false;
46685 jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv);
46689 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
46690 LDKNodeFeatures this_arg_conv;
46691 this_arg_conv.inner = untag_ptr(this_arg);
46692 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46693 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46694 this_arg_conv.is_owned = false;
46695 jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv);
46699 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1zero_1conf(JNIEnv *env, jclass clz, int64_t this_arg) {
46700 LDKChannelTypeFeatures this_arg_conv;
46701 this_arg_conv.inner = untag_ptr(this_arg);
46702 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46703 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46704 this_arg_conv.is_owned = false;
46705 jboolean ret_conv = ChannelTypeFeatures_requires_zero_conf(&this_arg_conv);
46709 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1optional(JNIEnv *env, jclass clz, int64_t this_arg) {
46710 LDKNodeFeatures this_arg_conv;
46711 this_arg_conv.inner = untag_ptr(this_arg);
46712 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46713 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46714 this_arg_conv.is_owned = false;
46715 NodeFeatures_set_keysend_optional(&this_arg_conv);
46718 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1set_1keysend_1required(JNIEnv *env, jclass clz, int64_t this_arg) {
46719 LDKNodeFeatures this_arg_conv;
46720 this_arg_conv.inner = untag_ptr(this_arg);
46721 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46722 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46723 this_arg_conv.is_owned = false;
46724 NodeFeatures_set_keysend_required(&this_arg_conv);
46727 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1supports_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) {
46728 LDKNodeFeatures this_arg_conv;
46729 this_arg_conv.inner = untag_ptr(this_arg);
46730 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46731 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46732 this_arg_conv.is_owned = false;
46733 jboolean ret_conv = NodeFeatures_supports_keysend(&this_arg_conv);
46737 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1keysend(JNIEnv *env, jclass clz, int64_t this_arg) {
46738 LDKNodeFeatures this_arg_conv;
46739 this_arg_conv.inner = untag_ptr(this_arg);
46740 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46741 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46742 this_arg_conv.is_owned = false;
46743 jboolean ret_conv = NodeFeatures_requires_keysend(&this_arg_conv);
46747 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
46748 LDKShutdownScript this_obj_conv;
46749 this_obj_conv.inner = untag_ptr(this_obj);
46750 this_obj_conv.is_owned = ptr_is_owned(this_obj);
46751 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
46752 ShutdownScript_free(this_obj_conv);
46755 static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) {
46756 LDKShutdownScript ret_var = ShutdownScript_clone(arg);
46757 int64_t ret_ref = 0;
46758 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46759 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46762 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
46763 LDKShutdownScript arg_conv;
46764 arg_conv.inner = untag_ptr(arg);
46765 arg_conv.is_owned = ptr_is_owned(arg);
46766 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
46767 arg_conv.is_owned = false;
46768 int64_t ret_conv = ShutdownScript_clone_ptr(&arg_conv);
46772 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) {
46773 LDKShutdownScript orig_conv;
46774 orig_conv.inner = untag_ptr(orig);
46775 orig_conv.is_owned = ptr_is_owned(orig);
46776 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
46777 orig_conv.is_owned = false;
46778 LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv);
46779 int64_t ret_ref = 0;
46780 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46781 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46785 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
46786 LDKShutdownScript a_conv;
46787 a_conv.inner = untag_ptr(a);
46788 a_conv.is_owned = ptr_is_owned(a);
46789 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
46790 a_conv.is_owned = false;
46791 LDKShutdownScript b_conv;
46792 b_conv.inner = untag_ptr(b);
46793 b_conv.is_owned = ptr_is_owned(b);
46794 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
46795 b_conv.is_owned = false;
46796 jboolean ret_conv = ShutdownScript_eq(&a_conv, &b_conv);
46800 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
46801 LDKInvalidShutdownScript this_obj_conv;
46802 this_obj_conv.inner = untag_ptr(this_obj);
46803 this_obj_conv.is_owned = ptr_is_owned(this_obj);
46804 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
46805 InvalidShutdownScript_free(this_obj_conv);
46808 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1get_1script(JNIEnv *env, jclass clz, int64_t this_ptr) {
46809 LDKInvalidShutdownScript this_ptr_conv;
46810 this_ptr_conv.inner = untag_ptr(this_ptr);
46811 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46812 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46813 this_ptr_conv.is_owned = false;
46814 LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv);
46815 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
46816 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
46820 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1set_1script(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
46821 LDKInvalidShutdownScript this_ptr_conv;
46822 this_ptr_conv.inner = untag_ptr(this_ptr);
46823 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
46824 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
46825 this_ptr_conv.is_owned = false;
46826 LDKCVec_u8Z val_ref;
46827 val_ref.datalen = (*env)->GetArrayLength(env, val);
46828 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
46829 (*env)->GetByteArrayRegion(env, val, 0, val_ref.datalen, val_ref.data);
46830 InvalidShutdownScript_set_script(&this_ptr_conv, val_ref);
46833 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1new(JNIEnv *env, jclass clz, int8_tArray script_arg) {
46834 LDKCVec_u8Z script_arg_ref;
46835 script_arg_ref.datalen = (*env)->GetArrayLength(env, script_arg);
46836 script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes");
46837 (*env)->GetByteArrayRegion(env, script_arg, 0, script_arg_ref.datalen, script_arg_ref.data);
46838 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref);
46839 int64_t ret_ref = 0;
46840 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46841 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46845 static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) {
46846 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg);
46847 int64_t ret_ref = 0;
46848 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46849 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46852 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
46853 LDKInvalidShutdownScript arg_conv;
46854 arg_conv.inner = untag_ptr(arg);
46855 arg_conv.is_owned = ptr_is_owned(arg);
46856 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
46857 arg_conv.is_owned = false;
46858 int64_t ret_conv = InvalidShutdownScript_clone_ptr(&arg_conv);
46862 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1clone(JNIEnv *env, jclass clz, int64_t orig) {
46863 LDKInvalidShutdownScript orig_conv;
46864 orig_conv.inner = untag_ptr(orig);
46865 orig_conv.is_owned = ptr_is_owned(orig);
46866 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
46867 orig_conv.is_owned = false;
46868 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv);
46869 int64_t ret_ref = 0;
46870 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46871 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46875 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1write(JNIEnv *env, jclass clz, int64_t obj) {
46876 LDKShutdownScript obj_conv;
46877 obj_conv.inner = untag_ptr(obj);
46878 obj_conv.is_owned = ptr_is_owned(obj);
46879 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
46880 obj_conv.is_owned = false;
46881 LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv);
46882 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
46883 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
46884 CVec_u8Z_free(ret_var);
46888 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
46889 LDKu8slice ser_ref;
46890 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
46891 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
46892 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
46893 *ret_conv = ShutdownScript_read(ser_ref);
46894 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
46895 return tag_ptr(ret_conv, true);
46898 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wpkh(JNIEnv *env, jclass clz, int8_tArray pubkey_hash) {
46899 uint8_t pubkey_hash_arr[20];
46900 CHECK((*env)->GetArrayLength(env, pubkey_hash) == 20);
46901 (*env)->GetByteArrayRegion(env, pubkey_hash, 0, 20, pubkey_hash_arr);
46902 uint8_t (*pubkey_hash_ref)[20] = &pubkey_hash_arr;
46903 LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref);
46904 int64_t ret_ref = 0;
46905 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46906 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46910 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1p2wsh(JNIEnv *env, jclass clz, int8_tArray script_hash) {
46911 uint8_t script_hash_arr[32];
46912 CHECK((*env)->GetArrayLength(env, script_hash) == 32);
46913 (*env)->GetByteArrayRegion(env, script_hash, 0, 32, script_hash_arr);
46914 uint8_t (*script_hash_ref)[32] = &script_hash_arr;
46915 LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref);
46916 int64_t ret_ref = 0;
46917 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
46918 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
46922 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1new_1witness_1program(JNIEnv *env, jclass clz, int8_t version, int8_tArray program) {
46924 LDKu8slice program_ref;
46925 program_ref.datalen = (*env)->GetArrayLength(env, program);
46926 program_ref.data = (*env)->GetByteArrayElements (env, program, NULL);
46927 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
46928 *ret_conv = ShutdownScript_new_witness_program((LDKWitnessVersion){ ._0 = version }, program_ref);
46929 (*env)->ReleaseByteArrayElements(env, program, (int8_t*)program_ref.data, 0);
46930 return tag_ptr(ret_conv, true);
46933 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1into_1inner(JNIEnv *env, jclass clz, int64_t this_arg) {
46934 LDKShutdownScript this_arg_conv;
46935 this_arg_conv.inner = untag_ptr(this_arg);
46936 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46937 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46938 this_arg_conv = ShutdownScript_clone(&this_arg_conv);
46939 LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv);
46940 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
46941 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
46942 CVec_u8Z_free(ret_var);
46946 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1as_1legacy_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) {
46947 LDKShutdownScript this_arg_conv;
46948 this_arg_conv.inner = untag_ptr(this_arg);
46949 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46950 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46951 this_arg_conv.is_owned = false;
46952 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
46953 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form);
46957 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1is_1compatible(JNIEnv *env, jclass clz, int64_t this_arg, int64_t features) {
46958 LDKShutdownScript this_arg_conv;
46959 this_arg_conv.inner = untag_ptr(this_arg);
46960 this_arg_conv.is_owned = ptr_is_owned(this_arg);
46961 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
46962 this_arg_conv.is_owned = false;
46963 LDKInitFeatures features_conv;
46964 features_conv.inner = untag_ptr(features);
46965 features_conv.is_owned = ptr_is_owned(features);
46966 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv);
46967 features_conv.is_owned = false;
46968 jboolean ret_conv = ShutdownScript_is_compatible(&this_arg_conv, &features_conv);
46972 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Retry_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
46973 if (!ptr_is_owned(this_ptr)) return;
46974 void* this_ptr_ptr = untag_ptr(this_ptr);
46975 CHECK_ACCESS(this_ptr_ptr);
46976 LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr);
46977 FREE(untag_ptr(this_ptr));
46978 Retry_free(this_ptr_conv);
46981 static inline uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) {
46982 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
46983 *ret_copy = Retry_clone(arg);
46984 int64_t ret_ref = tag_ptr(ret_copy, true);
46987 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
46988 LDKRetry* arg_conv = (LDKRetry*)untag_ptr(arg);
46989 int64_t ret_conv = Retry_clone_ptr(arg_conv);
46993 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1clone(JNIEnv *env, jclass clz, int64_t orig) {
46994 LDKRetry* orig_conv = (LDKRetry*)untag_ptr(orig);
46995 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
46996 *ret_copy = Retry_clone(orig_conv);
46997 int64_t ret_ref = tag_ptr(ret_copy, true);
47001 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1attempts(JNIEnv *env, jclass clz, int64_t a) {
47002 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
47003 *ret_copy = Retry_attempts(a);
47004 int64_t ret_ref = tag_ptr(ret_copy, true);
47008 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1timeout(JNIEnv *env, jclass clz, int64_t a) {
47009 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
47010 *ret_copy = Retry_timeout(a);
47011 int64_t ret_ref = tag_ptr(ret_copy, true);
47015 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Retry_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
47016 LDKRetry* a_conv = (LDKRetry*)untag_ptr(a);
47017 LDKRetry* b_conv = (LDKRetry*)untag_ptr(b);
47018 jboolean ret_conv = Retry_eq(a_conv, b_conv);
47022 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Retry_1hash(JNIEnv *env, jclass clz, int64_t o) {
47023 LDKRetry* o_conv = (LDKRetry*)untag_ptr(o);
47024 int64_t ret_conv = Retry_hash(o_conv);
47028 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47029 LDKRetryableSendFailure* orig_conv = (LDKRetryableSendFailure*)untag_ptr(orig);
47030 jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_clone(orig_conv));
47034 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1payment_1expired(JNIEnv *env, jclass clz) {
47035 jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_payment_expired());
47039 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1route_1not_1found(JNIEnv *env, jclass clz) {
47040 jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_route_not_found());
47044 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RetryableSendFailure_1duplicate_1payment(JNIEnv *env, jclass clz) {
47045 jclass ret_conv = LDKRetryableSendFailure_to_java(env, RetryableSendFailure_duplicate_payment());
47049 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
47050 if (!ptr_is_owned(this_ptr)) return;
47051 void* this_ptr_ptr = untag_ptr(this_ptr);
47052 CHECK_ACCESS(this_ptr_ptr);
47053 LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr);
47054 FREE(untag_ptr(this_ptr));
47055 PaymentSendFailure_free(this_ptr_conv);
47058 static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) {
47059 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
47060 *ret_copy = PaymentSendFailure_clone(arg);
47061 int64_t ret_ref = tag_ptr(ret_copy, true);
47064 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47065 LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)untag_ptr(arg);
47066 int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv);
47070 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47071 LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)untag_ptr(orig);
47072 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
47073 *ret_copy = PaymentSendFailure_clone(orig_conv);
47074 int64_t ret_ref = tag_ptr(ret_copy, true);
47078 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error(JNIEnv *env, jclass clz, int64_t a) {
47079 void* a_ptr = untag_ptr(a);
47080 CHECK_ACCESS(a_ptr);
47081 LDKAPIError a_conv = *(LDKAPIError*)(a_ptr);
47082 a_conv = APIError_clone((LDKAPIError*)untag_ptr(a));
47083 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
47084 *ret_copy = PaymentSendFailure_parameter_error(a_conv);
47085 int64_t ret_ref = tag_ptr(ret_copy, true);
47089 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1path_1parameter_1error(JNIEnv *env, jclass clz, int64_tArray a) {
47090 LDKCVec_CResult_NoneAPIErrorZZ a_constr;
47091 a_constr.datalen = (*env)->GetArrayLength(env, a);
47092 if (a_constr.datalen > 0)
47093 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
47095 a_constr.data = NULL;
47096 int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
47097 for (size_t w = 0; w < a_constr.datalen; w++) {
47098 int64_t a_conv_22 = a_vals[w];
47099 void* a_conv_22_ptr = untag_ptr(a_conv_22);
47100 CHECK_ACCESS(a_conv_22_ptr);
47101 LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
47102 a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(a_conv_22));
47103 a_constr.data[w] = a_conv_22_conv;
47105 (*env)->ReleaseLongArrayElements(env, a, a_vals, 0);
47106 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
47107 *ret_copy = PaymentSendFailure_path_parameter_error(a_constr);
47108 int64_t ret_ref = tag_ptr(ret_copy, true);
47112 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1resend_1safe(JNIEnv *env, jclass clz, int64_tArray a) {
47113 LDKCVec_APIErrorZ a_constr;
47114 a_constr.datalen = (*env)->GetArrayLength(env, a);
47115 if (a_constr.datalen > 0)
47116 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
47118 a_constr.data = NULL;
47119 int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
47120 for (size_t k = 0; k < a_constr.datalen; k++) {
47121 int64_t a_conv_10 = a_vals[k];
47122 void* a_conv_10_ptr = untag_ptr(a_conv_10);
47123 CHECK_ACCESS(a_conv_10_ptr);
47124 LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr);
47125 a_conv_10_conv = APIError_clone((LDKAPIError*)untag_ptr(a_conv_10));
47126 a_constr.data[k] = a_conv_10_conv;
47128 (*env)->ReleaseLongArrayElements(env, a, a_vals, 0);
47129 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
47130 *ret_copy = PaymentSendFailure_all_failed_resend_safe(a_constr);
47131 int64_t ret_ref = tag_ptr(ret_copy, true);
47135 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1duplicate_1payment(JNIEnv *env, jclass clz) {
47136 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
47137 *ret_copy = PaymentSendFailure_duplicate_payment();
47138 int64_t ret_ref = tag_ptr(ret_copy, true);
47142 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) {
47143 LDKCVec_CResult_NoneAPIErrorZZ results_constr;
47144 results_constr.datalen = (*env)->GetArrayLength(env, results);
47145 if (results_constr.datalen > 0)
47146 results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
47148 results_constr.data = NULL;
47149 int64_t* results_vals = (*env)->GetLongArrayElements (env, results, NULL);
47150 for (size_t w = 0; w < results_constr.datalen; w++) {
47151 int64_t results_conv_22 = results_vals[w];
47152 void* results_conv_22_ptr = untag_ptr(results_conv_22);
47153 CHECK_ACCESS(results_conv_22_ptr);
47154 LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr);
47155 results_constr.data[w] = results_conv_22_conv;
47157 (*env)->ReleaseLongArrayElements(env, results, results_vals, 0);
47158 LDKRouteParameters failed_paths_retry_conv;
47159 failed_paths_retry_conv.inner = untag_ptr(failed_paths_retry);
47160 failed_paths_retry_conv.is_owned = ptr_is_owned(failed_paths_retry);
47161 CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv);
47162 failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv);
47163 LDKThirtyTwoBytes payment_id_ref;
47164 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
47165 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
47166 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
47167 *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref);
47168 int64_t ret_ref = tag_ptr(ret_copy, true);
47172 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47173 LDKRecipientOnionFields this_obj_conv;
47174 this_obj_conv.inner = untag_ptr(this_obj);
47175 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47176 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47177 RecipientOnionFields_free(this_obj_conv);
47180 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1get_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr) {
47181 LDKRecipientOnionFields this_ptr_conv;
47182 this_ptr_conv.inner = untag_ptr(this_ptr);
47183 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47184 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47185 this_ptr_conv.is_owned = false;
47186 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
47187 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, RecipientOnionFields_get_payment_secret(&this_ptr_conv).data);
47191 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1set_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
47192 LDKRecipientOnionFields this_ptr_conv;
47193 this_ptr_conv.inner = untag_ptr(this_ptr);
47194 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47195 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47196 this_ptr_conv.is_owned = false;
47197 LDKThirtyTwoBytes val_ref;
47198 CHECK((*env)->GetArrayLength(env, val) == 32);
47199 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
47200 RecipientOnionFields_set_payment_secret(&this_ptr_conv, val_ref);
47203 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1get_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_ptr) {
47204 LDKRecipientOnionFields this_ptr_conv;
47205 this_ptr_conv.inner = untag_ptr(this_ptr);
47206 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47207 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47208 this_ptr_conv.is_owned = false;
47209 LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ");
47210 *ret_copy = RecipientOnionFields_get_payment_metadata(&this_ptr_conv);
47211 int64_t ret_ref = tag_ptr(ret_copy, true);
47215 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1set_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47216 LDKRecipientOnionFields this_ptr_conv;
47217 this_ptr_conv.inner = untag_ptr(this_ptr);
47218 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47219 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47220 this_ptr_conv.is_owned = false;
47221 void* val_ptr = untag_ptr(val);
47222 CHECK_ACCESS(val_ptr);
47223 LDKCOption_CVec_u8ZZ val_conv = *(LDKCOption_CVec_u8ZZ*)(val_ptr);
47224 val_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(val));
47225 RecipientOnionFields_set_payment_metadata(&this_ptr_conv, val_conv);
47228 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1new(JNIEnv *env, jclass clz, int8_tArray payment_secret_arg, int64_t payment_metadata_arg) {
47229 LDKThirtyTwoBytes payment_secret_arg_ref;
47230 CHECK((*env)->GetArrayLength(env, payment_secret_arg) == 32);
47231 (*env)->GetByteArrayRegion(env, payment_secret_arg, 0, 32, payment_secret_arg_ref.data);
47232 void* payment_metadata_arg_ptr = untag_ptr(payment_metadata_arg);
47233 CHECK_ACCESS(payment_metadata_arg_ptr);
47234 LDKCOption_CVec_u8ZZ payment_metadata_arg_conv = *(LDKCOption_CVec_u8ZZ*)(payment_metadata_arg_ptr);
47235 payment_metadata_arg_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(payment_metadata_arg));
47236 LDKRecipientOnionFields ret_var = RecipientOnionFields_new(payment_secret_arg_ref, payment_metadata_arg_conv);
47237 int64_t ret_ref = 0;
47238 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47239 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47243 static inline uint64_t RecipientOnionFields_clone_ptr(LDKRecipientOnionFields *NONNULL_PTR arg) {
47244 LDKRecipientOnionFields ret_var = RecipientOnionFields_clone(arg);
47245 int64_t ret_ref = 0;
47246 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47247 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47250 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47251 LDKRecipientOnionFields arg_conv;
47252 arg_conv.inner = untag_ptr(arg);
47253 arg_conv.is_owned = ptr_is_owned(arg);
47254 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
47255 arg_conv.is_owned = false;
47256 int64_t ret_conv = RecipientOnionFields_clone_ptr(&arg_conv);
47260 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47261 LDKRecipientOnionFields orig_conv;
47262 orig_conv.inner = untag_ptr(orig);
47263 orig_conv.is_owned = ptr_is_owned(orig);
47264 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
47265 orig_conv.is_owned = false;
47266 LDKRecipientOnionFields ret_var = RecipientOnionFields_clone(&orig_conv);
47267 int64_t ret_ref = 0;
47268 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47269 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47273 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
47274 LDKRecipientOnionFields a_conv;
47275 a_conv.inner = untag_ptr(a);
47276 a_conv.is_owned = ptr_is_owned(a);
47277 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
47278 a_conv.is_owned = false;
47279 LDKRecipientOnionFields b_conv;
47280 b_conv.inner = untag_ptr(b);
47281 b_conv.is_owned = ptr_is_owned(b);
47282 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
47283 b_conv.is_owned = false;
47284 jboolean ret_conv = RecipientOnionFields_eq(&a_conv, &b_conv);
47288 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1write(JNIEnv *env, jclass clz, int64_t obj) {
47289 LDKRecipientOnionFields obj_conv;
47290 obj_conv.inner = untag_ptr(obj);
47291 obj_conv.is_owned = ptr_is_owned(obj);
47292 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
47293 obj_conv.is_owned = false;
47294 LDKCVec_u8Z ret_var = RecipientOnionFields_write(&obj_conv);
47295 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
47296 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
47297 CVec_u8Z_free(ret_var);
47301 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
47302 LDKu8slice ser_ref;
47303 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
47304 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
47305 LDKCResult_RecipientOnionFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RecipientOnionFieldsDecodeErrorZ), "LDKCResult_RecipientOnionFieldsDecodeErrorZ");
47306 *ret_conv = RecipientOnionFields_read(ser_ref);
47307 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
47308 return tag_ptr(ret_conv, true);
47311 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1secret_1only(JNIEnv *env, jclass clz, int8_tArray payment_secret) {
47312 LDKThirtyTwoBytes payment_secret_ref;
47313 CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
47314 (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
47315 LDKRecipientOnionFields ret_var = RecipientOnionFields_secret_only(payment_secret_ref);
47316 int64_t ret_ref = 0;
47317 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47318 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47322 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RecipientOnionFields_1spontaneous_1empty(JNIEnv *env, jclass clz) {
47323 LDKRecipientOnionFields ret_var = RecipientOnionFields_spontaneous_empty();
47324 int64_t ret_ref = 0;
47325 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47326 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47330 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomMessageReader_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
47331 if (!ptr_is_owned(this_ptr)) return;
47332 void* this_ptr_ptr = untag_ptr(this_ptr);
47333 CHECK_ACCESS(this_ptr_ptr);
47334 LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr);
47335 FREE(untag_ptr(this_ptr));
47336 CustomMessageReader_free(this_ptr_conv);
47339 static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) {
47340 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
47341 *ret_ret = Type_clone(arg);
47342 return tag_ptr(ret_ret, true);
47344 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47345 void* arg_ptr = untag_ptr(arg);
47346 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
47347 LDKType* arg_conv = (LDKType*)arg_ptr;
47348 int64_t ret_conv = Type_clone_ptr(arg_conv);
47352 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Type_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47353 void* orig_ptr = untag_ptr(orig);
47354 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
47355 LDKType* orig_conv = (LDKType*)orig_ptr;
47356 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
47357 *ret_ret = Type_clone(orig_conv);
47358 return tag_ptr(ret_ret, true);
47361 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Type_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
47362 if (!ptr_is_owned(this_ptr)) return;
47363 void* this_ptr_ptr = untag_ptr(this_ptr);
47364 CHECK_ACCESS(this_ptr_ptr);
47365 LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr);
47366 FREE(untag_ptr(this_ptr));
47367 Type_free(this_ptr_conv);
47370 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedInvoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47371 LDKUnsignedInvoice this_obj_conv;
47372 this_obj_conv.inner = untag_ptr(this_obj);
47373 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47374 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47375 UnsignedInvoice_free(this_obj_conv);
47378 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_UnsignedInvoice_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) {
47379 LDKUnsignedInvoice this_arg_conv;
47380 this_arg_conv.inner = untag_ptr(this_arg);
47381 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47382 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47383 this_arg_conv.is_owned = false;
47384 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
47385 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, UnsignedInvoice_signing_pubkey(&this_arg_conv).compressed_form);
47389 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47390 LDKBlindedPayInfo this_obj_conv;
47391 this_obj_conv.inner = untag_ptr(this_obj);
47392 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47393 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47394 BlindedPayInfo_free(this_obj_conv);
47397 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
47398 LDKBlindedPayInfo this_ptr_conv;
47399 this_ptr_conv.inner = untag_ptr(this_ptr);
47400 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47401 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47402 this_ptr_conv.is_owned = false;
47403 int32_t ret_conv = BlindedPayInfo_get_fee_base_msat(&this_ptr_conv);
47407 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1fee_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
47408 LDKBlindedPayInfo this_ptr_conv;
47409 this_ptr_conv.inner = untag_ptr(this_ptr);
47410 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47411 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47412 this_ptr_conv.is_owned = false;
47413 BlindedPayInfo_set_fee_base_msat(&this_ptr_conv, val);
47416 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
47417 LDKBlindedPayInfo this_ptr_conv;
47418 this_ptr_conv.inner = untag_ptr(this_ptr);
47419 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47420 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47421 this_ptr_conv.is_owned = false;
47422 int32_t ret_conv = BlindedPayInfo_get_fee_proportional_millionths(&this_ptr_conv);
47426 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1fee_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
47427 LDKBlindedPayInfo this_ptr_conv;
47428 this_ptr_conv.inner = untag_ptr(this_ptr);
47429 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47430 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47431 this_ptr_conv.is_owned = false;
47432 BlindedPayInfo_set_fee_proportional_millionths(&this_ptr_conv, val);
47435 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
47436 LDKBlindedPayInfo this_ptr_conv;
47437 this_ptr_conv.inner = untag_ptr(this_ptr);
47438 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47439 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47440 this_ptr_conv.is_owned = false;
47441 int16_t ret_conv = BlindedPayInfo_get_cltv_expiry_delta(&this_ptr_conv);
47445 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
47446 LDKBlindedPayInfo this_ptr_conv;
47447 this_ptr_conv.inner = untag_ptr(this_ptr);
47448 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47449 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47450 this_ptr_conv.is_owned = false;
47451 BlindedPayInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
47454 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
47455 LDKBlindedPayInfo this_ptr_conv;
47456 this_ptr_conv.inner = untag_ptr(this_ptr);
47457 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47458 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47459 this_ptr_conv.is_owned = false;
47460 int64_t ret_conv = BlindedPayInfo_get_htlc_minimum_msat(&this_ptr_conv);
47464 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47465 LDKBlindedPayInfo this_ptr_conv;
47466 this_ptr_conv.inner = untag_ptr(this_ptr);
47467 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47468 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47469 this_ptr_conv.is_owned = false;
47470 BlindedPayInfo_set_htlc_minimum_msat(&this_ptr_conv, val);
47473 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
47474 LDKBlindedPayInfo this_ptr_conv;
47475 this_ptr_conv.inner = untag_ptr(this_ptr);
47476 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47477 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47478 this_ptr_conv.is_owned = false;
47479 int64_t ret_conv = BlindedPayInfo_get_htlc_maximum_msat(&this_ptr_conv);
47483 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47484 LDKBlindedPayInfo this_ptr_conv;
47485 this_ptr_conv.inner = untag_ptr(this_ptr);
47486 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47487 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47488 this_ptr_conv.is_owned = false;
47489 BlindedPayInfo_set_htlc_maximum_msat(&this_ptr_conv, val);
47492 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
47493 LDKBlindedPayInfo this_ptr_conv;
47494 this_ptr_conv.inner = untag_ptr(this_ptr);
47495 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47496 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47497 this_ptr_conv.is_owned = false;
47498 LDKBlindedHopFeatures ret_var = BlindedPayInfo_get_features(&this_ptr_conv);
47499 int64_t ret_ref = 0;
47500 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47501 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47505 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
47506 LDKBlindedPayInfo this_ptr_conv;
47507 this_ptr_conv.inner = untag_ptr(this_ptr);
47508 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
47509 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
47510 this_ptr_conv.is_owned = false;
47511 LDKBlindedHopFeatures val_conv;
47512 val_conv.inner = untag_ptr(val);
47513 val_conv.is_owned = ptr_is_owned(val);
47514 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
47515 val_conv = BlindedHopFeatures_clone(&val_conv);
47516 BlindedPayInfo_set_features(&this_ptr_conv, val_conv);
47519 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1new(JNIEnv *env, jclass clz, int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg, int64_t htlc_maximum_msat_arg, int64_t features_arg) {
47520 LDKBlindedHopFeatures features_arg_conv;
47521 features_arg_conv.inner = untag_ptr(features_arg);
47522 features_arg_conv.is_owned = ptr_is_owned(features_arg);
47523 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
47524 features_arg_conv = BlindedHopFeatures_clone(&features_arg_conv);
47525 LDKBlindedPayInfo ret_var = BlindedPayInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, features_arg_conv);
47526 int64_t ret_ref = 0;
47527 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47528 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47532 static inline uint64_t BlindedPayInfo_clone_ptr(LDKBlindedPayInfo *NONNULL_PTR arg) {
47533 LDKBlindedPayInfo ret_var = BlindedPayInfo_clone(arg);
47534 int64_t ret_ref = 0;
47535 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47536 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47539 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47540 LDKBlindedPayInfo arg_conv;
47541 arg_conv.inner = untag_ptr(arg);
47542 arg_conv.is_owned = ptr_is_owned(arg);
47543 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
47544 arg_conv.is_owned = false;
47545 int64_t ret_conv = BlindedPayInfo_clone_ptr(&arg_conv);
47549 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47550 LDKBlindedPayInfo orig_conv;
47551 orig_conv.inner = untag_ptr(orig);
47552 orig_conv.is_owned = ptr_is_owned(orig);
47553 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
47554 orig_conv.is_owned = false;
47555 LDKBlindedPayInfo ret_var = BlindedPayInfo_clone(&orig_conv);
47556 int64_t ret_ref = 0;
47557 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47558 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47562 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1hash(JNIEnv *env, jclass clz, int64_t o) {
47563 LDKBlindedPayInfo o_conv;
47564 o_conv.inner = untag_ptr(o);
47565 o_conv.is_owned = ptr_is_owned(o);
47566 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
47567 o_conv.is_owned = false;
47568 int64_t ret_conv = BlindedPayInfo_hash(&o_conv);
47572 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
47573 LDKBlindedPayInfo a_conv;
47574 a_conv.inner = untag_ptr(a);
47575 a_conv.is_owned = ptr_is_owned(a);
47576 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
47577 a_conv.is_owned = false;
47578 LDKBlindedPayInfo b_conv;
47579 b_conv.inner = untag_ptr(b);
47580 b_conv.is_owned = ptr_is_owned(b);
47581 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
47582 b_conv.is_owned = false;
47583 jboolean ret_conv = BlindedPayInfo_eq(&a_conv, &b_conv);
47587 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
47588 LDKBlindedPayInfo obj_conv;
47589 obj_conv.inner = untag_ptr(obj);
47590 obj_conv.is_owned = ptr_is_owned(obj);
47591 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
47592 obj_conv.is_owned = false;
47593 LDKCVec_u8Z ret_var = BlindedPayInfo_write(&obj_conv);
47594 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
47595 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
47596 CVec_u8Z_free(ret_var);
47600 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPayInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
47601 LDKu8slice ser_ref;
47602 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
47603 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
47604 LDKCResult_BlindedPayInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPayInfoDecodeErrorZ), "LDKCResult_BlindedPayInfoDecodeErrorZ");
47605 *ret_conv = BlindedPayInfo_read(ser_ref);
47606 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
47607 return tag_ptr(ret_conv, true);
47610 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedInvoiceRequest_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47611 LDKUnsignedInvoiceRequest this_obj_conv;
47612 this_obj_conv.inner = untag_ptr(this_obj);
47613 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47614 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47615 UnsignedInvoiceRequest_free(this_obj_conv);
47618 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47619 LDKInvoiceRequest this_obj_conv;
47620 this_obj_conv.inner = untag_ptr(this_obj);
47621 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47622 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47623 InvoiceRequest_free(this_obj_conv);
47626 static inline uint64_t InvoiceRequest_clone_ptr(LDKInvoiceRequest *NONNULL_PTR arg) {
47627 LDKInvoiceRequest ret_var = InvoiceRequest_clone(arg);
47628 int64_t ret_ref = 0;
47629 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47630 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47633 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47634 LDKInvoiceRequest arg_conv;
47635 arg_conv.inner = untag_ptr(arg);
47636 arg_conv.is_owned = ptr_is_owned(arg);
47637 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
47638 arg_conv.is_owned = false;
47639 int64_t ret_conv = InvoiceRequest_clone_ptr(&arg_conv);
47643 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47644 LDKInvoiceRequest orig_conv;
47645 orig_conv.inner = untag_ptr(orig);
47646 orig_conv.is_owned = ptr_is_owned(orig);
47647 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
47648 orig_conv.is_owned = false;
47649 LDKInvoiceRequest ret_var = InvoiceRequest_clone(&orig_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 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) {
47657 LDKInvoiceRequest this_arg_conv;
47658 this_arg_conv.inner = untag_ptr(this_arg);
47659 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47660 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47661 this_arg_conv.is_owned = false;
47662 LDKu8slice ret_var = InvoiceRequest_metadata(&this_arg_conv);
47663 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
47664 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
47668 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1chain(JNIEnv *env, jclass clz, int64_t this_arg) {
47669 LDKInvoiceRequest this_arg_conv;
47670 this_arg_conv.inner = untag_ptr(this_arg);
47671 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47672 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47673 this_arg_conv.is_owned = false;
47674 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
47675 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, InvoiceRequest_chain(&this_arg_conv).data);
47679 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) {
47680 LDKInvoiceRequest this_arg_conv;
47681 this_arg_conv.inner = untag_ptr(this_arg);
47682 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47683 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47684 this_arg_conv.is_owned = false;
47685 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
47686 *ret_copy = InvoiceRequest_amount_msats(&this_arg_conv);
47687 int64_t ret_ref = tag_ptr(ret_copy, true);
47691 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
47692 LDKInvoiceRequest this_arg_conv;
47693 this_arg_conv.inner = untag_ptr(this_arg);
47694 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47695 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47696 this_arg_conv.is_owned = false;
47697 LDKInvoiceRequestFeatures ret_var = InvoiceRequest_features(&this_arg_conv);
47698 int64_t ret_ref = 0;
47699 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47700 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47704 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) {
47705 LDKInvoiceRequest this_arg_conv;
47706 this_arg_conv.inner = untag_ptr(this_arg);
47707 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47708 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47709 this_arg_conv.is_owned = false;
47710 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
47711 *ret_copy = InvoiceRequest_quantity(&this_arg_conv);
47712 int64_t ret_ref = tag_ptr(ret_copy, true);
47716 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
47717 LDKInvoiceRequest this_arg_conv;
47718 this_arg_conv.inner = untag_ptr(this_arg);
47719 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47720 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47721 this_arg_conv.is_owned = false;
47722 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
47723 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, InvoiceRequest_payer_id(&this_arg_conv).compressed_form);
47727 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) {
47728 LDKInvoiceRequest this_arg_conv;
47729 this_arg_conv.inner = untag_ptr(this_arg);
47730 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47731 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47732 this_arg_conv.is_owned = false;
47733 LDKPrintableString ret_var = InvoiceRequest_payer_note(&this_arg_conv);
47734 int64_t ret_ref = 0;
47735 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47736 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47740 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequest_1write(JNIEnv *env, jclass clz, int64_t obj) {
47741 LDKInvoiceRequest obj_conv;
47742 obj_conv.inner = untag_ptr(obj);
47743 obj_conv.is_owned = ptr_is_owned(obj);
47744 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
47745 obj_conv.is_owned = false;
47746 LDKCVec_u8Z ret_var = InvoiceRequest_write(&obj_conv);
47747 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
47748 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
47749 CVec_u8Z_free(ret_var);
47753 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Offer_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47754 LDKOffer this_obj_conv;
47755 this_obj_conv.inner = untag_ptr(this_obj);
47756 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47757 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47758 Offer_free(this_obj_conv);
47761 static inline uint64_t Offer_clone_ptr(LDKOffer *NONNULL_PTR arg) {
47762 LDKOffer ret_var = Offer_clone(arg);
47763 int64_t ret_ref = 0;
47764 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47765 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47768 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
47770 arg_conv.inner = untag_ptr(arg);
47771 arg_conv.is_owned = ptr_is_owned(arg);
47772 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
47773 arg_conv.is_owned = false;
47774 int64_t ret_conv = Offer_clone_ptr(&arg_conv);
47778 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1clone(JNIEnv *env, jclass clz, int64_t orig) {
47779 LDKOffer orig_conv;
47780 orig_conv.inner = untag_ptr(orig);
47781 orig_conv.is_owned = ptr_is_owned(orig);
47782 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
47783 orig_conv.is_owned = false;
47784 LDKOffer ret_var = Offer_clone(&orig_conv);
47785 int64_t ret_ref = 0;
47786 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47787 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47791 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Offer_1chains(JNIEnv *env, jclass clz, int64_t this_arg) {
47792 LDKOffer this_arg_conv;
47793 this_arg_conv.inner = untag_ptr(this_arg);
47794 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47795 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47796 this_arg_conv.is_owned = false;
47797 LDKCVec_ChainHashZ ret_var = Offer_chains(&this_arg_conv);
47798 jobjectArray ret_arr = NULL;
47799 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL);
47801 for (size_t i = 0; i < ret_var.datalen; i++) {
47802 int8_tArray ret_conv_8_arr = (*env)->NewByteArray(env, 32);
47803 (*env)->SetByteArrayRegion(env, ret_conv_8_arr, 0, 32, ret_var.data[i].data);
47804 (*env)->SetObjectArrayElement(env, ret_arr, i, ret_conv_8_arr);
47807 FREE(ret_var.data);
47811 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1supports_1chain(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray chain) {
47812 LDKOffer this_arg_conv;
47813 this_arg_conv.inner = untag_ptr(this_arg);
47814 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47815 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47816 this_arg_conv.is_owned = false;
47817 LDKThirtyTwoBytes chain_ref;
47818 CHECK((*env)->GetArrayLength(env, chain) == 32);
47819 (*env)->GetByteArrayRegion(env, chain, 0, 32, chain_ref.data);
47820 jboolean ret_conv = Offer_supports_chain(&this_arg_conv, chain_ref);
47824 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) {
47825 LDKOffer this_arg_conv;
47826 this_arg_conv.inner = untag_ptr(this_arg);
47827 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47828 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47829 this_arg_conv.is_owned = false;
47830 LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ");
47831 *ret_copy = Offer_metadata(&this_arg_conv);
47832 int64_t ret_ref = tag_ptr(ret_copy, true);
47836 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1amount(JNIEnv *env, jclass clz, int64_t this_arg) {
47837 LDKOffer this_arg_conv;
47838 this_arg_conv.inner = untag_ptr(this_arg);
47839 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47840 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47841 this_arg_conv.is_owned = false;
47842 LDKAmount ret_var = Offer_amount(&this_arg_conv);
47843 int64_t ret_ref = 0;
47844 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47845 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47849 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1description(JNIEnv *env, jclass clz, int64_t this_arg) {
47850 LDKOffer this_arg_conv;
47851 this_arg_conv.inner = untag_ptr(this_arg);
47852 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47853 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47854 this_arg_conv.is_owned = false;
47855 LDKPrintableString ret_var = Offer_description(&this_arg_conv);
47856 int64_t ret_ref = 0;
47857 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47858 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47862 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
47863 LDKOffer this_arg_conv;
47864 this_arg_conv.inner = untag_ptr(this_arg);
47865 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47866 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47867 this_arg_conv.is_owned = false;
47868 LDKOfferFeatures ret_var = Offer_features(&this_arg_conv);
47869 int64_t ret_ref = 0;
47870 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47871 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47875 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) {
47876 LDKOffer this_arg_conv;
47877 this_arg_conv.inner = untag_ptr(this_arg);
47878 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47879 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47880 this_arg_conv.is_owned = false;
47881 LDKCOption_DurationZ *ret_copy = MALLOC(sizeof(LDKCOption_DurationZ), "LDKCOption_DurationZ");
47882 *ret_copy = Offer_absolute_expiry(&this_arg_conv);
47883 int64_t ret_ref = tag_ptr(ret_copy, true);
47887 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) {
47888 LDKOffer this_arg_conv;
47889 this_arg_conv.inner = untag_ptr(this_arg);
47890 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47891 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47892 this_arg_conv.is_owned = false;
47893 jboolean ret_conv = Offer_is_expired(&this_arg_conv);
47897 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) {
47898 LDKOffer this_arg_conv;
47899 this_arg_conv.inner = untag_ptr(this_arg);
47900 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47901 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47902 this_arg_conv.is_owned = false;
47903 LDKPrintableString ret_var = Offer_issuer(&this_arg_conv);
47904 int64_t ret_ref = 0;
47905 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47906 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47910 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Offer_1paths(JNIEnv *env, jclass clz, int64_t this_arg) {
47911 LDKOffer this_arg_conv;
47912 this_arg_conv.inner = untag_ptr(this_arg);
47913 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47914 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47915 this_arg_conv.is_owned = false;
47916 LDKCVec_BlindedPathZ ret_var = Offer_paths(&this_arg_conv);
47917 int64_tArray ret_arr = NULL;
47918 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
47919 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
47920 for (size_t n = 0; n < ret_var.datalen; n++) {
47921 LDKBlindedPath ret_conv_13_var = ret_var.data[n];
47922 int64_t ret_conv_13_ref = 0;
47923 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var);
47924 ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned);
47925 ret_arr_ptr[n] = ret_conv_13_ref;
47927 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
47928 FREE(ret_var.data);
47932 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Offer_1supported_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) {
47933 LDKOffer this_arg_conv;
47934 this_arg_conv.inner = untag_ptr(this_arg);
47935 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47936 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47937 this_arg_conv.is_owned = false;
47938 LDKQuantity ret_var = Offer_supported_quantity(&this_arg_conv);
47939 int64_t ret_ref = 0;
47940 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
47941 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
47945 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1is_1valid_1quantity(JNIEnv *env, jclass clz, int64_t this_arg, int64_t quantity) {
47946 LDKOffer this_arg_conv;
47947 this_arg_conv.inner = untag_ptr(this_arg);
47948 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47949 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47950 this_arg_conv.is_owned = false;
47951 jboolean ret_conv = Offer_is_valid_quantity(&this_arg_conv, quantity);
47955 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Offer_1expects_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) {
47956 LDKOffer this_arg_conv;
47957 this_arg_conv.inner = untag_ptr(this_arg);
47958 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47959 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47960 this_arg_conv.is_owned = false;
47961 jboolean ret_conv = Offer_expects_quantity(&this_arg_conv);
47965 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Offer_1signing_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) {
47966 LDKOffer this_arg_conv;
47967 this_arg_conv.inner = untag_ptr(this_arg);
47968 this_arg_conv.is_owned = ptr_is_owned(this_arg);
47969 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
47970 this_arg_conv.is_owned = false;
47971 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
47972 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Offer_signing_pubkey(&this_arg_conv).compressed_form);
47976 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Offer_1write(JNIEnv *env, jclass clz, int64_t obj) {
47978 obj_conv.inner = untag_ptr(obj);
47979 obj_conv.is_owned = ptr_is_owned(obj);
47980 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
47981 obj_conv.is_owned = false;
47982 LDKCVec_u8Z ret_var = Offer_write(&obj_conv);
47983 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
47984 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
47985 CVec_u8Z_free(ret_var);
47989 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Amount_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
47990 LDKAmount this_obj_conv;
47991 this_obj_conv.inner = untag_ptr(this_obj);
47992 this_obj_conv.is_owned = ptr_is_owned(this_obj);
47993 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
47994 Amount_free(this_obj_conv);
47997 static inline uint64_t Amount_clone_ptr(LDKAmount *NONNULL_PTR arg) {
47998 LDKAmount ret_var = Amount_clone(arg);
47999 int64_t ret_ref = 0;
48000 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48001 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48004 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Amount_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
48005 LDKAmount arg_conv;
48006 arg_conv.inner = untag_ptr(arg);
48007 arg_conv.is_owned = ptr_is_owned(arg);
48008 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
48009 arg_conv.is_owned = false;
48010 int64_t ret_conv = Amount_clone_ptr(&arg_conv);
48014 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Amount_1clone(JNIEnv *env, jclass clz, int64_t orig) {
48015 LDKAmount orig_conv;
48016 orig_conv.inner = untag_ptr(orig);
48017 orig_conv.is_owned = ptr_is_owned(orig);
48018 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
48019 orig_conv.is_owned = false;
48020 LDKAmount ret_var = Amount_clone(&orig_conv);
48021 int64_t ret_ref = 0;
48022 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48023 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48027 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Quantity_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48028 LDKQuantity this_obj_conv;
48029 this_obj_conv.inner = untag_ptr(this_obj);
48030 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48031 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48032 Quantity_free(this_obj_conv);
48035 static inline uint64_t Quantity_clone_ptr(LDKQuantity *NONNULL_PTR arg) {
48036 LDKQuantity ret_var = Quantity_clone(arg);
48037 int64_t ret_ref = 0;
48038 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48039 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48042 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
48043 LDKQuantity arg_conv;
48044 arg_conv.inner = untag_ptr(arg);
48045 arg_conv.is_owned = ptr_is_owned(arg);
48046 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
48047 arg_conv.is_owned = false;
48048 int64_t ret_conv = Quantity_clone_ptr(&arg_conv);
48052 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Quantity_1clone(JNIEnv *env, jclass clz, int64_t orig) {
48053 LDKQuantity orig_conv;
48054 orig_conv.inner = untag_ptr(orig);
48055 orig_conv.is_owned = ptr_is_owned(orig);
48056 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
48057 orig_conv.is_owned = false;
48058 LDKQuantity ret_var = Quantity_clone(&orig_conv);
48059 int64_t ret_ref = 0;
48060 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48061 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48065 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Refund_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48066 LDKRefund this_obj_conv;
48067 this_obj_conv.inner = untag_ptr(this_obj);
48068 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48069 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48070 Refund_free(this_obj_conv);
48073 static inline uint64_t Refund_clone_ptr(LDKRefund *NONNULL_PTR arg) {
48074 LDKRefund ret_var = Refund_clone(arg);
48075 int64_t ret_ref = 0;
48076 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48077 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48080 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
48081 LDKRefund arg_conv;
48082 arg_conv.inner = untag_ptr(arg);
48083 arg_conv.is_owned = ptr_is_owned(arg);
48084 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
48085 arg_conv.is_owned = false;
48086 int64_t ret_conv = Refund_clone_ptr(&arg_conv);
48090 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1clone(JNIEnv *env, jclass clz, int64_t orig) {
48091 LDKRefund orig_conv;
48092 orig_conv.inner = untag_ptr(orig);
48093 orig_conv.is_owned = ptr_is_owned(orig);
48094 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
48095 orig_conv.is_owned = false;
48096 LDKRefund ret_var = Refund_clone(&orig_conv);
48097 int64_t ret_ref = 0;
48098 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48099 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48103 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1description(JNIEnv *env, jclass clz, int64_t this_arg) {
48104 LDKRefund this_arg_conv;
48105 this_arg_conv.inner = untag_ptr(this_arg);
48106 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48107 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48108 this_arg_conv.is_owned = false;
48109 LDKPrintableString ret_var = Refund_description(&this_arg_conv);
48110 int64_t ret_ref = 0;
48111 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48112 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48116 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1absolute_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) {
48117 LDKRefund this_arg_conv;
48118 this_arg_conv.inner = untag_ptr(this_arg);
48119 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48120 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48121 this_arg_conv.is_owned = false;
48122 LDKCOption_DurationZ *ret_copy = MALLOC(sizeof(LDKCOption_DurationZ), "LDKCOption_DurationZ");
48123 *ret_copy = Refund_absolute_expiry(&this_arg_conv);
48124 int64_t ret_ref = tag_ptr(ret_copy, true);
48128 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Refund_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) {
48129 LDKRefund this_arg_conv;
48130 this_arg_conv.inner = untag_ptr(this_arg);
48131 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48132 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48133 this_arg_conv.is_owned = false;
48134 jboolean ret_conv = Refund_is_expired(&this_arg_conv);
48138 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1issuer(JNIEnv *env, jclass clz, int64_t this_arg) {
48139 LDKRefund this_arg_conv;
48140 this_arg_conv.inner = untag_ptr(this_arg);
48141 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48142 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48143 this_arg_conv.is_owned = false;
48144 LDKPrintableString ret_var = Refund_issuer(&this_arg_conv);
48145 int64_t ret_ref = 0;
48146 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48147 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48151 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1paths(JNIEnv *env, jclass clz, int64_t this_arg) {
48152 LDKRefund this_arg_conv;
48153 this_arg_conv.inner = untag_ptr(this_arg);
48154 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48155 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48156 this_arg_conv.is_owned = false;
48157 LDKCVec_BlindedPathZ ret_var = Refund_paths(&this_arg_conv);
48158 int64_tArray ret_arr = NULL;
48159 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
48160 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
48161 for (size_t n = 0; n < ret_var.datalen; n++) {
48162 LDKBlindedPath ret_conv_13_var = ret_var.data[n];
48163 int64_t ret_conv_13_ref = 0;
48164 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_13_var);
48165 ret_conv_13_ref = tag_ptr(ret_conv_13_var.inner, ret_conv_13_var.is_owned);
48166 ret_arr_ptr[n] = ret_conv_13_ref;
48168 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
48169 FREE(ret_var.data);
48173 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) {
48174 LDKRefund this_arg_conv;
48175 this_arg_conv.inner = untag_ptr(this_arg);
48176 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48177 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48178 this_arg_conv.is_owned = false;
48179 LDKu8slice ret_var = Refund_metadata(&this_arg_conv);
48180 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
48181 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
48185 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1chain(JNIEnv *env, jclass clz, int64_t this_arg) {
48186 LDKRefund this_arg_conv;
48187 this_arg_conv.inner = untag_ptr(this_arg);
48188 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48189 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48190 this_arg_conv.is_owned = false;
48191 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
48192 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Refund_chain(&this_arg_conv).data);
48196 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1amount_1msats(JNIEnv *env, jclass clz, int64_t this_arg) {
48197 LDKRefund this_arg_conv;
48198 this_arg_conv.inner = untag_ptr(this_arg);
48199 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48200 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48201 this_arg_conv.is_owned = false;
48202 int64_t ret_conv = Refund_amount_msats(&this_arg_conv);
48206 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
48207 LDKRefund this_arg_conv;
48208 this_arg_conv.inner = untag_ptr(this_arg);
48209 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48210 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48211 this_arg_conv.is_owned = false;
48212 LDKInvoiceRequestFeatures ret_var = Refund_features(&this_arg_conv);
48213 int64_t ret_ref = 0;
48214 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48215 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48219 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1quantity(JNIEnv *env, jclass clz, int64_t this_arg) {
48220 LDKRefund this_arg_conv;
48221 this_arg_conv.inner = untag_ptr(this_arg);
48222 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48223 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48224 this_arg_conv.is_owned = false;
48225 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
48226 *ret_copy = Refund_quantity(&this_arg_conv);
48227 int64_t ret_ref = tag_ptr(ret_copy, true);
48231 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1id(JNIEnv *env, jclass clz, int64_t this_arg) {
48232 LDKRefund this_arg_conv;
48233 this_arg_conv.inner = untag_ptr(this_arg);
48234 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48235 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48236 this_arg_conv.is_owned = false;
48237 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
48238 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Refund_payer_id(&this_arg_conv).compressed_form);
48242 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Refund_1payer_1note(JNIEnv *env, jclass clz, int64_t this_arg) {
48243 LDKRefund this_arg_conv;
48244 this_arg_conv.inner = untag_ptr(this_arg);
48245 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48246 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48247 this_arg_conv.is_owned = false;
48248 LDKPrintableString ret_var = Refund_payer_note(&this_arg_conv);
48249 int64_t ret_ref = 0;
48250 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48251 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48255 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Refund_1write(JNIEnv *env, jclass clz, int64_t obj) {
48256 LDKRefund obj_conv;
48257 obj_conv.inner = untag_ptr(obj);
48258 obj_conv.is_owned = ptr_is_owned(obj);
48259 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
48260 obj_conv.is_owned = false;
48261 LDKCVec_u8Z ret_var = Refund_write(&obj_conv);
48262 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
48263 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
48264 CVec_u8Z_free(ret_var);
48268 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
48269 LDKUtxoLookupError* orig_conv = (LDKUtxoLookupError*)untag_ptr(orig);
48270 jclass ret_conv = LDKUtxoLookupError_to_java(env, UtxoLookupError_clone(orig_conv));
48274 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1unknown_1chain(JNIEnv *env, jclass clz) {
48275 jclass ret_conv = LDKUtxoLookupError_to_java(env, UtxoLookupError_unknown_chain());
48279 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_UtxoLookupError_1unknown_1tx(JNIEnv *env, jclass clz) {
48280 jclass ret_conv = LDKUtxoLookupError_to_java(env, UtxoLookupError_unknown_tx());
48284 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoResult_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
48285 if (!ptr_is_owned(this_ptr)) return;
48286 void* this_ptr_ptr = untag_ptr(this_ptr);
48287 CHECK_ACCESS(this_ptr_ptr);
48288 LDKUtxoResult this_ptr_conv = *(LDKUtxoResult*)(this_ptr_ptr);
48289 FREE(untag_ptr(this_ptr));
48290 UtxoResult_free(this_ptr_conv);
48293 static inline uint64_t UtxoResult_clone_ptr(LDKUtxoResult *NONNULL_PTR arg) {
48294 LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult");
48295 *ret_copy = UtxoResult_clone(arg);
48296 int64_t ret_ref = tag_ptr(ret_copy, true);
48299 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
48300 LDKUtxoResult* arg_conv = (LDKUtxoResult*)untag_ptr(arg);
48301 int64_t ret_conv = UtxoResult_clone_ptr(arg_conv);
48305 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1clone(JNIEnv *env, jclass clz, int64_t orig) {
48306 LDKUtxoResult* orig_conv = (LDKUtxoResult*)untag_ptr(orig);
48307 LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult");
48308 *ret_copy = UtxoResult_clone(orig_conv);
48309 int64_t ret_ref = tag_ptr(ret_copy, true);
48313 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1sync(JNIEnv *env, jclass clz, int64_t a) {
48314 void* a_ptr = untag_ptr(a);
48315 CHECK_ACCESS(a_ptr);
48316 LDKCResult_TxOutUtxoLookupErrorZ a_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(a_ptr);
48317 a_conv = CResult_TxOutUtxoLookupErrorZ_clone((LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(a));
48318 LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult");
48319 *ret_copy = UtxoResult_sync(a_conv);
48320 int64_t ret_ref = tag_ptr(ret_copy, true);
48324 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoResult_1async(JNIEnv *env, jclass clz, int64_t a) {
48325 LDKUtxoFuture a_conv;
48326 a_conv.inner = untag_ptr(a);
48327 a_conv.is_owned = ptr_is_owned(a);
48328 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
48329 a_conv = UtxoFuture_clone(&a_conv);
48330 LDKUtxoResult *ret_copy = MALLOC(sizeof(LDKUtxoResult), "LDKUtxoResult");
48331 *ret_copy = UtxoResult_async(a_conv);
48332 int64_t ret_ref = tag_ptr(ret_copy, true);
48336 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoLookup_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
48337 if (!ptr_is_owned(this_ptr)) return;
48338 void* this_ptr_ptr = untag_ptr(this_ptr);
48339 CHECK_ACCESS(this_ptr_ptr);
48340 LDKUtxoLookup this_ptr_conv = *(LDKUtxoLookup*)(this_ptr_ptr);
48341 FREE(untag_ptr(this_ptr));
48342 UtxoLookup_free(this_ptr_conv);
48345 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48346 LDKUtxoFuture this_obj_conv;
48347 this_obj_conv.inner = untag_ptr(this_obj);
48348 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48349 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48350 UtxoFuture_free(this_obj_conv);
48353 static inline uint64_t UtxoFuture_clone_ptr(LDKUtxoFuture *NONNULL_PTR arg) {
48354 LDKUtxoFuture ret_var = UtxoFuture_clone(arg);
48355 int64_t ret_ref = 0;
48356 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48357 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48360 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
48361 LDKUtxoFuture arg_conv;
48362 arg_conv.inner = untag_ptr(arg);
48363 arg_conv.is_owned = ptr_is_owned(arg);
48364 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
48365 arg_conv.is_owned = false;
48366 int64_t ret_conv = UtxoFuture_clone_ptr(&arg_conv);
48370 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1clone(JNIEnv *env, jclass clz, int64_t orig) {
48371 LDKUtxoFuture orig_conv;
48372 orig_conv.inner = untag_ptr(orig);
48373 orig_conv.is_owned = ptr_is_owned(orig);
48374 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
48375 orig_conv.is_owned = false;
48376 LDKUtxoFuture ret_var = UtxoFuture_clone(&orig_conv);
48377 int64_t ret_ref = 0;
48378 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48379 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48383 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UtxoFuture_1new(JNIEnv *env, jclass clz) {
48384 LDKUtxoFuture ret_var = UtxoFuture_new();
48385 int64_t ret_ref = 0;
48386 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48387 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48391 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) {
48392 LDKUtxoFuture this_arg_conv;
48393 this_arg_conv.inner = untag_ptr(this_arg);
48394 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48395 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48396 this_arg_conv.is_owned = false;
48397 LDKNetworkGraph graph_conv;
48398 graph_conv.inner = untag_ptr(graph);
48399 graph_conv.is_owned = ptr_is_owned(graph);
48400 CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv);
48401 graph_conv.is_owned = false;
48402 void* result_ptr = untag_ptr(result);
48403 CHECK_ACCESS(result_ptr);
48404 LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr);
48405 UtxoFuture_resolve_without_forwarding(&this_arg_conv, &graph_conv, result_conv);
48408 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) {
48409 LDKUtxoFuture this_arg_conv;
48410 this_arg_conv.inner = untag_ptr(this_arg);
48411 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48412 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48413 this_arg_conv.is_owned = false;
48414 LDKNetworkGraph graph_conv;
48415 graph_conv.inner = untag_ptr(graph);
48416 graph_conv.is_owned = ptr_is_owned(graph);
48417 CHECK_INNER_FIELD_ACCESS_OR_NULL(graph_conv);
48418 graph_conv.is_owned = false;
48419 LDKP2PGossipSync gossip_conv;
48420 gossip_conv.inner = untag_ptr(gossip);
48421 gossip_conv.is_owned = ptr_is_owned(gossip);
48422 CHECK_INNER_FIELD_ACCESS_OR_NULL(gossip_conv);
48423 gossip_conv.is_owned = false;
48424 void* result_ptr = untag_ptr(result);
48425 CHECK_ACCESS(result_ptr);
48426 LDKCResult_TxOutUtxoLookupErrorZ result_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(result_ptr);
48427 UtxoFuture_resolve(&this_arg_conv, &graph_conv, &gossip_conv, result_conv);
48430 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeId_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48431 LDKNodeId this_obj_conv;
48432 this_obj_conv.inner = untag_ptr(this_obj);
48433 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48434 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48435 NodeId_free(this_obj_conv);
48438 static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) {
48439 LDKNodeId ret_var = NodeId_clone(arg);
48440 int64_t ret_ref = 0;
48441 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48442 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48445 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
48446 LDKNodeId arg_conv;
48447 arg_conv.inner = untag_ptr(arg);
48448 arg_conv.is_owned = ptr_is_owned(arg);
48449 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
48450 arg_conv.is_owned = false;
48451 int64_t ret_conv = NodeId_clone_ptr(&arg_conv);
48455 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1clone(JNIEnv *env, jclass clz, int64_t orig) {
48456 LDKNodeId orig_conv;
48457 orig_conv.inner = untag_ptr(orig);
48458 orig_conv.is_owned = ptr_is_owned(orig);
48459 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
48460 orig_conv.is_owned = false;
48461 LDKNodeId ret_var = NodeId_clone(&orig_conv);
48462 int64_t ret_ref = 0;
48463 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48464 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48468 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1from_1pubkey(JNIEnv *env, jclass clz, int8_tArray pubkey) {
48469 LDKPublicKey pubkey_ref;
48470 CHECK((*env)->GetArrayLength(env, pubkey) == 33);
48471 (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form);
48472 LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref);
48473 int64_t ret_ref = 0;
48474 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48475 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48479 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1slice(JNIEnv *env, jclass clz, int64_t this_arg) {
48480 LDKNodeId this_arg_conv;
48481 this_arg_conv.inner = untag_ptr(this_arg);
48482 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48483 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48484 this_arg_conv.is_owned = false;
48485 LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv);
48486 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
48487 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
48491 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1as_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg) {
48492 LDKNodeId this_arg_conv;
48493 this_arg_conv.inner = untag_ptr(this_arg);
48494 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48495 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48496 this_arg_conv.is_owned = false;
48497 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
48498 *ret_conv = NodeId_as_pubkey(&this_arg_conv);
48499 return tag_ptr(ret_conv, true);
48502 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1hash(JNIEnv *env, jclass clz, int64_t o) {
48504 o_conv.inner = untag_ptr(o);
48505 o_conv.is_owned = ptr_is_owned(o);
48506 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
48507 o_conv.is_owned = false;
48508 int64_t ret_conv = NodeId_hash(&o_conv);
48512 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeId_1write(JNIEnv *env, jclass clz, int64_t obj) {
48513 LDKNodeId obj_conv;
48514 obj_conv.inner = untag_ptr(obj);
48515 obj_conv.is_owned = ptr_is_owned(obj);
48516 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
48517 obj_conv.is_owned = false;
48518 LDKCVec_u8Z ret_var = NodeId_write(&obj_conv);
48519 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
48520 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
48521 CVec_u8Z_free(ret_var);
48525 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeId_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
48526 LDKu8slice ser_ref;
48527 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
48528 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
48529 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
48530 *ret_conv = NodeId_read(ser_ref);
48531 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
48532 return tag_ptr(ret_conv, true);
48535 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48536 LDKNetworkGraph this_obj_conv;
48537 this_obj_conv.inner = untag_ptr(this_obj);
48538 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48539 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48540 NetworkGraph_free(this_obj_conv);
48543 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48544 LDKReadOnlyNetworkGraph this_obj_conv;
48545 this_obj_conv.inner = untag_ptr(this_obj);
48546 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48547 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48548 ReadOnlyNetworkGraph_free(this_obj_conv);
48551 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
48552 if (!ptr_is_owned(this_ptr)) return;
48553 void* this_ptr_ptr = untag_ptr(this_ptr);
48554 CHECK_ACCESS(this_ptr_ptr);
48555 LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr);
48556 FREE(untag_ptr(this_ptr));
48557 NetworkUpdate_free(this_ptr_conv);
48560 static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) {
48561 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
48562 *ret_copy = NetworkUpdate_clone(arg);
48563 int64_t ret_ref = tag_ptr(ret_copy, true);
48566 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
48567 LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)untag_ptr(arg);
48568 int64_t ret_conv = NetworkUpdate_clone_ptr(arg_conv);
48572 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1clone(JNIEnv *env, jclass clz, int64_t orig) {
48573 LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)untag_ptr(orig);
48574 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
48575 *ret_copy = NetworkUpdate_clone(orig_conv);
48576 int64_t ret_ref = tag_ptr(ret_copy, true);
48580 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1update_1message(JNIEnv *env, jclass clz, int64_t msg) {
48581 LDKChannelUpdate msg_conv;
48582 msg_conv.inner = untag_ptr(msg);
48583 msg_conv.is_owned = ptr_is_owned(msg);
48584 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
48585 msg_conv = ChannelUpdate_clone(&msg_conv);
48586 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
48587 *ret_copy = NetworkUpdate_channel_update_message(msg_conv);
48588 int64_t ret_ref = tag_ptr(ret_copy, true);
48592 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1channel_1failure(JNIEnv *env, jclass clz, int64_t short_channel_id, jboolean is_permanent) {
48593 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
48594 *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent);
48595 int64_t ret_ref = tag_ptr(ret_copy, true);
48599 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1node_1failure(JNIEnv *env, jclass clz, int8_tArray node_id, jboolean is_permanent) {
48600 LDKPublicKey node_id_ref;
48601 CHECK((*env)->GetArrayLength(env, node_id) == 33);
48602 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
48603 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
48604 *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent);
48605 int64_t ret_ref = tag_ptr(ret_copy, true);
48609 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
48610 LDKNetworkUpdate* a_conv = (LDKNetworkUpdate*)untag_ptr(a);
48611 LDKNetworkUpdate* b_conv = (LDKNetworkUpdate*)untag_ptr(b);
48612 jboolean ret_conv = NetworkUpdate_eq(a_conv, b_conv);
48616 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
48617 LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj);
48618 LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv);
48619 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
48620 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
48621 CVec_u8Z_free(ret_var);
48625 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
48626 LDKu8slice ser_ref;
48627 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
48628 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
48629 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
48630 *ret_conv = NetworkUpdate_read(ser_ref);
48631 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
48632 return tag_ptr(ret_conv, true);
48635 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48636 LDKP2PGossipSync this_obj_conv;
48637 this_obj_conv.inner = untag_ptr(this_obj);
48638 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48639 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48640 P2PGossipSync_free(this_obj_conv);
48643 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) {
48644 LDKNetworkGraph network_graph_conv;
48645 network_graph_conv.inner = untag_ptr(network_graph);
48646 network_graph_conv.is_owned = ptr_is_owned(network_graph);
48647 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
48648 network_graph_conv.is_owned = false;
48649 void* utxo_lookup_ptr = untag_ptr(utxo_lookup);
48650 CHECK_ACCESS(utxo_lookup_ptr);
48651 LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr);
48652 // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ
48653 if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) {
48654 // Manually implement clone for Java trait instances
48655 if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) {
48656 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
48657 LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some);
48660 void* logger_ptr = untag_ptr(logger);
48661 CHECK_ACCESS(logger_ptr);
48662 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
48663 if (logger_conv.free == LDKLogger_JCalls_free) {
48664 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
48665 LDKLogger_JCalls_cloned(&logger_conv);
48667 LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, utxo_lookup_conv, logger_conv);
48668 int64_t ret_ref = 0;
48669 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48670 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48674 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1add_1utxo_1lookup(JNIEnv *env, jclass clz, int64_t this_arg, int64_t utxo_lookup) {
48675 LDKP2PGossipSync this_arg_conv;
48676 this_arg_conv.inner = untag_ptr(this_arg);
48677 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48678 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48679 this_arg_conv.is_owned = false;
48680 void* utxo_lookup_ptr = untag_ptr(utxo_lookup);
48681 CHECK_ACCESS(utxo_lookup_ptr);
48682 LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr);
48683 // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ
48684 if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) {
48685 // Manually implement clone for Java trait instances
48686 if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) {
48687 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
48688 LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some);
48691 P2PGossipSync_add_utxo_lookup(&this_arg_conv, utxo_lookup_conv);
48694 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1handle_1network_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_update) {
48695 LDKNetworkGraph this_arg_conv;
48696 this_arg_conv.inner = untag_ptr(this_arg);
48697 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48698 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48699 this_arg_conv.is_owned = false;
48700 LDKNetworkUpdate* network_update_conv = (LDKNetworkUpdate*)untag_ptr(network_update);
48701 NetworkGraph_handle_network_update(&this_arg_conv, network_update_conv);
48704 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
48705 LDKP2PGossipSync this_arg_conv;
48706 this_arg_conv.inner = untag_ptr(this_arg);
48707 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48708 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48709 this_arg_conv.is_owned = false;
48710 LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
48711 *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv);
48712 return tag_ptr(ret_ret, true);
48715 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
48716 LDKP2PGossipSync this_arg_conv;
48717 this_arg_conv.inner = untag_ptr(this_arg);
48718 this_arg_conv.is_owned = ptr_is_owned(this_arg);
48719 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
48720 this_arg_conv.is_owned = false;
48721 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
48722 *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv);
48723 return tag_ptr(ret_ret, true);
48726 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48727 LDKChannelUpdateInfo this_obj_conv;
48728 this_obj_conv.inner = untag_ptr(this_obj);
48729 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48730 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48731 ChannelUpdateInfo_free(this_obj_conv);
48734 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr) {
48735 LDKChannelUpdateInfo this_ptr_conv;
48736 this_ptr_conv.inner = untag_ptr(this_ptr);
48737 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48738 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48739 this_ptr_conv.is_owned = false;
48740 int32_t ret_conv = ChannelUpdateInfo_get_last_update(&this_ptr_conv);
48744 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
48745 LDKChannelUpdateInfo this_ptr_conv;
48746 this_ptr_conv.inner = untag_ptr(this_ptr);
48747 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48748 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48749 this_ptr_conv.is_owned = false;
48750 ChannelUpdateInfo_set_last_update(&this_ptr_conv, val);
48753 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1enabled(JNIEnv *env, jclass clz, int64_t this_ptr) {
48754 LDKChannelUpdateInfo this_ptr_conv;
48755 this_ptr_conv.inner = untag_ptr(this_ptr);
48756 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48757 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48758 this_ptr_conv.is_owned = false;
48759 jboolean ret_conv = ChannelUpdateInfo_get_enabled(&this_ptr_conv);
48763 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1enabled(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) {
48764 LDKChannelUpdateInfo this_ptr_conv;
48765 this_ptr_conv.inner = untag_ptr(this_ptr);
48766 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48767 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48768 this_ptr_conv.is_owned = false;
48769 ChannelUpdateInfo_set_enabled(&this_ptr_conv, val);
48772 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
48773 LDKChannelUpdateInfo this_ptr_conv;
48774 this_ptr_conv.inner = untag_ptr(this_ptr);
48775 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48776 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48777 this_ptr_conv.is_owned = false;
48778 int16_t ret_conv = ChannelUpdateInfo_get_cltv_expiry_delta(&this_ptr_conv);
48782 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
48783 LDKChannelUpdateInfo this_ptr_conv;
48784 this_ptr_conv.inner = untag_ptr(this_ptr);
48785 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48786 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48787 this_ptr_conv.is_owned = false;
48788 ChannelUpdateInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
48791 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
48792 LDKChannelUpdateInfo this_ptr_conv;
48793 this_ptr_conv.inner = untag_ptr(this_ptr);
48794 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48795 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48796 this_ptr_conv.is_owned = false;
48797 int64_t ret_conv = ChannelUpdateInfo_get_htlc_minimum_msat(&this_ptr_conv);
48801 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48802 LDKChannelUpdateInfo this_ptr_conv;
48803 this_ptr_conv.inner = untag_ptr(this_ptr);
48804 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48805 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48806 this_ptr_conv.is_owned = false;
48807 ChannelUpdateInfo_set_htlc_minimum_msat(&this_ptr_conv, val);
48810 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
48811 LDKChannelUpdateInfo this_ptr_conv;
48812 this_ptr_conv.inner = untag_ptr(this_ptr);
48813 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48814 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48815 this_ptr_conv.is_owned = false;
48816 int64_t ret_conv = ChannelUpdateInfo_get_htlc_maximum_msat(&this_ptr_conv);
48820 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48821 LDKChannelUpdateInfo this_ptr_conv;
48822 this_ptr_conv.inner = untag_ptr(this_ptr);
48823 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48824 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48825 this_ptr_conv.is_owned = false;
48826 ChannelUpdateInfo_set_htlc_maximum_msat(&this_ptr_conv, val);
48829 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1fees(JNIEnv *env, jclass clz, int64_t this_ptr) {
48830 LDKChannelUpdateInfo this_ptr_conv;
48831 this_ptr_conv.inner = untag_ptr(this_ptr);
48832 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48833 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48834 this_ptr_conv.is_owned = false;
48835 LDKRoutingFees ret_var = ChannelUpdateInfo_get_fees(&this_ptr_conv);
48836 int64_t ret_ref = 0;
48837 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48838 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48842 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1fees(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48843 LDKChannelUpdateInfo this_ptr_conv;
48844 this_ptr_conv.inner = untag_ptr(this_ptr);
48845 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48846 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48847 this_ptr_conv.is_owned = false;
48848 LDKRoutingFees val_conv;
48849 val_conv.inner = untag_ptr(val);
48850 val_conv.is_owned = ptr_is_owned(val);
48851 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
48852 val_conv = RoutingFees_clone(&val_conv);
48853 ChannelUpdateInfo_set_fees(&this_ptr_conv, val_conv);
48856 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1get_1last_1update_1message(JNIEnv *env, jclass clz, int64_t this_ptr) {
48857 LDKChannelUpdateInfo this_ptr_conv;
48858 this_ptr_conv.inner = untag_ptr(this_ptr);
48859 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48860 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48861 this_ptr_conv.is_owned = false;
48862 LDKChannelUpdate ret_var = ChannelUpdateInfo_get_last_update_message(&this_ptr_conv);
48863 int64_t ret_ref = 0;
48864 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48865 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48869 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1set_1last_1update_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48870 LDKChannelUpdateInfo this_ptr_conv;
48871 this_ptr_conv.inner = untag_ptr(this_ptr);
48872 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48873 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48874 this_ptr_conv.is_owned = false;
48875 LDKChannelUpdate val_conv;
48876 val_conv.inner = untag_ptr(val);
48877 val_conv.is_owned = ptr_is_owned(val);
48878 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
48879 val_conv = ChannelUpdate_clone(&val_conv);
48880 ChannelUpdateInfo_set_last_update_message(&this_ptr_conv, val_conv);
48883 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) {
48884 LDKRoutingFees fees_arg_conv;
48885 fees_arg_conv.inner = untag_ptr(fees_arg);
48886 fees_arg_conv.is_owned = ptr_is_owned(fees_arg);
48887 CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
48888 fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
48889 LDKChannelUpdate last_update_message_arg_conv;
48890 last_update_message_arg_conv.inner = untag_ptr(last_update_message_arg);
48891 last_update_message_arg_conv.is_owned = ptr_is_owned(last_update_message_arg);
48892 CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv);
48893 last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv);
48894 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);
48895 int64_t ret_ref = 0;
48896 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48897 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48901 static inline uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg) {
48902 LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(arg);
48903 int64_t ret_ref = 0;
48904 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48905 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48908 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
48909 LDKChannelUpdateInfo arg_conv;
48910 arg_conv.inner = untag_ptr(arg);
48911 arg_conv.is_owned = ptr_is_owned(arg);
48912 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
48913 arg_conv.is_owned = false;
48914 int64_t ret_conv = ChannelUpdateInfo_clone_ptr(&arg_conv);
48918 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
48919 LDKChannelUpdateInfo orig_conv;
48920 orig_conv.inner = untag_ptr(orig);
48921 orig_conv.is_owned = ptr_is_owned(orig);
48922 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
48923 orig_conv.is_owned = false;
48924 LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(&orig_conv);
48925 int64_t ret_ref = 0;
48926 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48927 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48931 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
48932 LDKChannelUpdateInfo a_conv;
48933 a_conv.inner = untag_ptr(a);
48934 a_conv.is_owned = ptr_is_owned(a);
48935 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
48936 a_conv.is_owned = false;
48937 LDKChannelUpdateInfo b_conv;
48938 b_conv.inner = untag_ptr(b);
48939 b_conv.is_owned = ptr_is_owned(b);
48940 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
48941 b_conv.is_owned = false;
48942 jboolean ret_conv = ChannelUpdateInfo_eq(&a_conv, &b_conv);
48946 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
48947 LDKChannelUpdateInfo obj_conv;
48948 obj_conv.inner = untag_ptr(obj);
48949 obj_conv.is_owned = ptr_is_owned(obj);
48950 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
48951 obj_conv.is_owned = false;
48952 LDKCVec_u8Z ret_var = ChannelUpdateInfo_write(&obj_conv);
48953 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
48954 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
48955 CVec_u8Z_free(ret_var);
48959 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
48960 LDKu8slice ser_ref;
48961 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
48962 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
48963 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
48964 *ret_conv = ChannelUpdateInfo_read(ser_ref);
48965 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
48966 return tag_ptr(ret_conv, true);
48969 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
48970 LDKChannelInfo this_obj_conv;
48971 this_obj_conv.inner = untag_ptr(this_obj);
48972 this_obj_conv.is_owned = ptr_is_owned(this_obj);
48973 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
48974 ChannelInfo_free(this_obj_conv);
48977 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
48978 LDKChannelInfo this_ptr_conv;
48979 this_ptr_conv.inner = untag_ptr(this_ptr);
48980 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48981 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48982 this_ptr_conv.is_owned = false;
48983 LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv);
48984 int64_t ret_ref = 0;
48985 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
48986 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
48990 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
48991 LDKChannelInfo this_ptr_conv;
48992 this_ptr_conv.inner = untag_ptr(this_ptr);
48993 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
48994 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
48995 this_ptr_conv.is_owned = false;
48996 LDKChannelFeatures val_conv;
48997 val_conv.inner = untag_ptr(val);
48998 val_conv.is_owned = ptr_is_owned(val);
48999 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
49000 val_conv = ChannelFeatures_clone(&val_conv);
49001 ChannelInfo_set_features(&this_ptr_conv, val_conv);
49004 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one(JNIEnv *env, jclass clz, int64_t this_ptr) {
49005 LDKChannelInfo this_ptr_conv;
49006 this_ptr_conv.inner = untag_ptr(this_ptr);
49007 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49008 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49009 this_ptr_conv.is_owned = false;
49010 LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv);
49011 int64_t ret_ref = 0;
49012 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49013 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49017 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
49018 LDKChannelInfo this_ptr_conv;
49019 this_ptr_conv.inner = untag_ptr(this_ptr);
49020 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49021 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49022 this_ptr_conv.is_owned = false;
49023 LDKNodeId val_conv;
49024 val_conv.inner = untag_ptr(val);
49025 val_conv.is_owned = ptr_is_owned(val);
49026 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
49027 val_conv = NodeId_clone(&val_conv);
49028 ChannelInfo_set_node_one(&this_ptr_conv, val_conv);
49031 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two(JNIEnv *env, jclass clz, int64_t this_ptr) {
49032 LDKChannelInfo this_ptr_conv;
49033 this_ptr_conv.inner = untag_ptr(this_ptr);
49034 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49035 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49036 this_ptr_conv.is_owned = false;
49037 LDKChannelUpdateInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv);
49038 int64_t ret_ref = 0;
49039 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49040 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49044 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
49045 LDKChannelInfo this_ptr_conv;
49046 this_ptr_conv.inner = untag_ptr(this_ptr);
49047 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49048 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49049 this_ptr_conv.is_owned = false;
49050 LDKChannelUpdateInfo val_conv;
49051 val_conv.inner = untag_ptr(val);
49052 val_conv.is_owned = ptr_is_owned(val);
49053 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
49054 val_conv = ChannelUpdateInfo_clone(&val_conv);
49055 ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv);
49058 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two(JNIEnv *env, jclass clz, int64_t this_ptr) {
49059 LDKChannelInfo this_ptr_conv;
49060 this_ptr_conv.inner = untag_ptr(this_ptr);
49061 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49062 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49063 this_ptr_conv.is_owned = false;
49064 LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv);
49065 int64_t ret_ref = 0;
49066 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49067 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49071 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
49072 LDKChannelInfo this_ptr_conv;
49073 this_ptr_conv.inner = untag_ptr(this_ptr);
49074 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49075 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49076 this_ptr_conv.is_owned = false;
49077 LDKNodeId val_conv;
49078 val_conv.inner = untag_ptr(val);
49079 val_conv.is_owned = ptr_is_owned(val);
49080 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
49081 val_conv = NodeId_clone(&val_conv);
49082 ChannelInfo_set_node_two(&this_ptr_conv, val_conv);
49085 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one(JNIEnv *env, jclass clz, int64_t this_ptr) {
49086 LDKChannelInfo this_ptr_conv;
49087 this_ptr_conv.inner = untag_ptr(this_ptr);
49088 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49089 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49090 this_ptr_conv.is_owned = false;
49091 LDKChannelUpdateInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv);
49092 int64_t ret_ref = 0;
49093 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49094 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49098 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
49099 LDKChannelInfo this_ptr_conv;
49100 this_ptr_conv.inner = untag_ptr(this_ptr);
49101 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49102 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49103 this_ptr_conv.is_owned = false;
49104 LDKChannelUpdateInfo val_conv;
49105 val_conv.inner = untag_ptr(val);
49106 val_conv.is_owned = ptr_is_owned(val);
49107 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
49108 val_conv = ChannelUpdateInfo_clone(&val_conv);
49109 ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv);
49112 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1capacity_1sats(JNIEnv *env, jclass clz, int64_t this_ptr) {
49113 LDKChannelInfo this_ptr_conv;
49114 this_ptr_conv.inner = untag_ptr(this_ptr);
49115 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49116 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49117 this_ptr_conv.is_owned = false;
49118 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
49119 *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv);
49120 int64_t ret_ref = tag_ptr(ret_copy, true);
49124 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1capacity_1sats(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
49125 LDKChannelInfo this_ptr_conv;
49126 this_ptr_conv.inner = untag_ptr(this_ptr);
49127 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49128 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49129 this_ptr_conv.is_owned = false;
49130 void* val_ptr = untag_ptr(val);
49131 CHECK_ACCESS(val_ptr);
49132 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
49133 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
49134 ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv);
49137 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr) {
49138 LDKChannelInfo this_ptr_conv;
49139 this_ptr_conv.inner = untag_ptr(this_ptr);
49140 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49141 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49142 this_ptr_conv.is_owned = false;
49143 LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv);
49144 int64_t ret_ref = 0;
49145 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49146 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49150 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
49151 LDKChannelInfo this_ptr_conv;
49152 this_ptr_conv.inner = untag_ptr(this_ptr);
49153 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49154 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49155 this_ptr_conv.is_owned = false;
49156 LDKChannelAnnouncement val_conv;
49157 val_conv.inner = untag_ptr(val);
49158 val_conv.is_owned = ptr_is_owned(val);
49159 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
49160 val_conv = ChannelAnnouncement_clone(&val_conv);
49161 ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv);
49164 static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) {
49165 LDKChannelInfo ret_var = ChannelInfo_clone(arg);
49166 int64_t ret_ref = 0;
49167 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49168 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49171 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49172 LDKChannelInfo arg_conv;
49173 arg_conv.inner = untag_ptr(arg);
49174 arg_conv.is_owned = ptr_is_owned(arg);
49175 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
49176 arg_conv.is_owned = false;
49177 int64_t ret_conv = ChannelInfo_clone_ptr(&arg_conv);
49181 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49182 LDKChannelInfo orig_conv;
49183 orig_conv.inner = untag_ptr(orig);
49184 orig_conv.is_owned = ptr_is_owned(orig);
49185 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
49186 orig_conv.is_owned = false;
49187 LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv);
49188 int64_t ret_ref = 0;
49189 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49190 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49194 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
49195 LDKChannelInfo a_conv;
49196 a_conv.inner = untag_ptr(a);
49197 a_conv.is_owned = ptr_is_owned(a);
49198 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
49199 a_conv.is_owned = false;
49200 LDKChannelInfo b_conv;
49201 b_conv.inner = untag_ptr(b);
49202 b_conv.is_owned = ptr_is_owned(b);
49203 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
49204 b_conv.is_owned = false;
49205 jboolean ret_conv = ChannelInfo_eq(&a_conv, &b_conv);
49209 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) {
49210 LDKChannelInfo this_arg_conv;
49211 this_arg_conv.inner = untag_ptr(this_arg);
49212 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49213 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49214 this_arg_conv.is_owned = false;
49215 LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags);
49216 int64_t ret_ref = 0;
49217 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49218 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49222 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
49223 LDKChannelInfo obj_conv;
49224 obj_conv.inner = untag_ptr(obj);
49225 obj_conv.is_owned = ptr_is_owned(obj);
49226 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
49227 obj_conv.is_owned = false;
49228 LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv);
49229 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
49230 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
49231 CVec_u8Z_free(ret_var);
49235 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
49236 LDKu8slice ser_ref;
49237 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
49238 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
49239 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
49240 *ret_conv = ChannelInfo_read(ser_ref);
49241 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
49242 return tag_ptr(ret_conv, true);
49245 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49246 LDKDirectedChannelInfo this_obj_conv;
49247 this_obj_conv.inner = untag_ptr(this_obj);
49248 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49249 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49250 DirectedChannelInfo_free(this_obj_conv);
49253 static inline uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg) {
49254 LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(arg);
49255 int64_t ret_ref = 0;
49256 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49257 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49260 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49261 LDKDirectedChannelInfo arg_conv;
49262 arg_conv.inner = untag_ptr(arg);
49263 arg_conv.is_owned = ptr_is_owned(arg);
49264 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
49265 arg_conv.is_owned = false;
49266 int64_t ret_conv = DirectedChannelInfo_clone_ptr(&arg_conv);
49270 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49271 LDKDirectedChannelInfo orig_conv;
49272 orig_conv.inner = untag_ptr(orig);
49273 orig_conv.is_owned = ptr_is_owned(orig);
49274 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
49275 orig_conv.is_owned = false;
49276 LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(&orig_conv);
49277 int64_t ret_ref = 0;
49278 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49279 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49283 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1channel(JNIEnv *env, jclass clz, int64_t this_arg) {
49284 LDKDirectedChannelInfo this_arg_conv;
49285 this_arg_conv.inner = untag_ptr(this_arg);
49286 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49287 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49288 this_arg_conv.is_owned = false;
49289 LDKChannelInfo ret_var = DirectedChannelInfo_channel(&this_arg_conv);
49290 int64_t ret_ref = 0;
49291 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49292 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49296 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_arg) {
49297 LDKDirectedChannelInfo this_arg_conv;
49298 this_arg_conv.inner = untag_ptr(this_arg);
49299 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49300 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49301 this_arg_conv.is_owned = false;
49302 int64_t ret_conv = DirectedChannelInfo_htlc_maximum_msat(&this_arg_conv);
49306 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_arg) {
49307 LDKDirectedChannelInfo this_arg_conv;
49308 this_arg_conv.inner = untag_ptr(this_arg);
49309 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49310 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49311 this_arg_conv.is_owned = false;
49312 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
49313 *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv);
49314 int64_t ret_ref = tag_ptr(ret_copy, true);
49318 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
49319 if (!ptr_is_owned(this_ptr)) return;
49320 void* this_ptr_ptr = untag_ptr(this_ptr);
49321 CHECK_ACCESS(this_ptr_ptr);
49322 LDKEffectiveCapacity this_ptr_conv = *(LDKEffectiveCapacity*)(this_ptr_ptr);
49323 FREE(untag_ptr(this_ptr));
49324 EffectiveCapacity_free(this_ptr_conv);
49327 static inline uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg) {
49328 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
49329 *ret_copy = EffectiveCapacity_clone(arg);
49330 int64_t ret_ref = tag_ptr(ret_copy, true);
49333 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49334 LDKEffectiveCapacity* arg_conv = (LDKEffectiveCapacity*)untag_ptr(arg);
49335 int64_t ret_conv = EffectiveCapacity_clone_ptr(arg_conv);
49339 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49340 LDKEffectiveCapacity* orig_conv = (LDKEffectiveCapacity*)untag_ptr(orig);
49341 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
49342 *ret_copy = EffectiveCapacity_clone(orig_conv);
49343 int64_t ret_ref = tag_ptr(ret_copy, true);
49347 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1exact_1liquidity(JNIEnv *env, jclass clz, int64_t liquidity_msat) {
49348 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
49349 *ret_copy = EffectiveCapacity_exact_liquidity(liquidity_msat);
49350 int64_t ret_ref = tag_ptr(ret_copy, true);
49354 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1maximum_1htlc(JNIEnv *env, jclass clz, int64_t amount_msat) {
49355 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
49356 *ret_copy = EffectiveCapacity_maximum_htlc(amount_msat);
49357 int64_t ret_ref = tag_ptr(ret_copy, true);
49361 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1total(JNIEnv *env, jclass clz, int64_t capacity_msat, int64_t htlc_maximum_msat) {
49362 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
49363 *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat);
49364 int64_t ret_ref = tag_ptr(ret_copy, true);
49368 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1infinite(JNIEnv *env, jclass clz) {
49369 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
49370 *ret_copy = EffectiveCapacity_infinite();
49371 int64_t ret_ref = tag_ptr(ret_copy, true);
49375 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1unknown(JNIEnv *env, jclass clz) {
49376 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
49377 *ret_copy = EffectiveCapacity_unknown();
49378 int64_t ret_ref = tag_ptr(ret_copy, true);
49382 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1as_1msat(JNIEnv *env, jclass clz, int64_t this_arg) {
49383 LDKEffectiveCapacity* this_arg_conv = (LDKEffectiveCapacity*)untag_ptr(this_arg);
49384 int64_t ret_conv = EffectiveCapacity_as_msat(this_arg_conv);
49388 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49389 LDKRoutingFees this_obj_conv;
49390 this_obj_conv.inner = untag_ptr(this_obj);
49391 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49392 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49393 RoutingFees_free(this_obj_conv);
49396 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
49397 LDKRoutingFees this_ptr_conv;
49398 this_ptr_conv.inner = untag_ptr(this_ptr);
49399 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49400 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49401 this_ptr_conv.is_owned = false;
49402 int32_t ret_conv = RoutingFees_get_base_msat(&this_ptr_conv);
49406 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
49407 LDKRoutingFees this_ptr_conv;
49408 this_ptr_conv.inner = untag_ptr(this_ptr);
49409 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49410 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49411 this_ptr_conv.is_owned = false;
49412 RoutingFees_set_base_msat(&this_ptr_conv, val);
49415 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr) {
49416 LDKRoutingFees this_ptr_conv;
49417 this_ptr_conv.inner = untag_ptr(this_ptr);
49418 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49419 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49420 this_ptr_conv.is_owned = false;
49421 int32_t ret_conv = RoutingFees_get_proportional_millionths(&this_ptr_conv);
49425 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
49426 LDKRoutingFees this_ptr_conv;
49427 this_ptr_conv.inner = untag_ptr(this_ptr);
49428 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49429 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49430 this_ptr_conv.is_owned = false;
49431 RoutingFees_set_proportional_millionths(&this_ptr_conv, val);
49434 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) {
49435 LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_arg);
49436 int64_t ret_ref = 0;
49437 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49438 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49442 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RoutingFees_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
49443 LDKRoutingFees a_conv;
49444 a_conv.inner = untag_ptr(a);
49445 a_conv.is_owned = ptr_is_owned(a);
49446 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
49447 a_conv.is_owned = false;
49448 LDKRoutingFees b_conv;
49449 b_conv.inner = untag_ptr(b);
49450 b_conv.is_owned = ptr_is_owned(b);
49451 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
49452 b_conv.is_owned = false;
49453 jboolean ret_conv = RoutingFees_eq(&a_conv, &b_conv);
49457 static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) {
49458 LDKRoutingFees ret_var = RoutingFees_clone(arg);
49459 int64_t ret_ref = 0;
49460 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49461 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49464 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49465 LDKRoutingFees arg_conv;
49466 arg_conv.inner = untag_ptr(arg);
49467 arg_conv.is_owned = ptr_is_owned(arg);
49468 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
49469 arg_conv.is_owned = false;
49470 int64_t ret_conv = RoutingFees_clone_ptr(&arg_conv);
49474 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49475 LDKRoutingFees orig_conv;
49476 orig_conv.inner = untag_ptr(orig);
49477 orig_conv.is_owned = ptr_is_owned(orig);
49478 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
49479 orig_conv.is_owned = false;
49480 LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv);
49481 int64_t ret_ref = 0;
49482 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49483 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49487 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1hash(JNIEnv *env, jclass clz, int64_t o) {
49488 LDKRoutingFees o_conv;
49489 o_conv.inner = untag_ptr(o);
49490 o_conv.is_owned = ptr_is_owned(o);
49491 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
49492 o_conv.is_owned = false;
49493 int64_t ret_conv = RoutingFees_hash(&o_conv);
49497 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv *env, jclass clz, int64_t obj) {
49498 LDKRoutingFees obj_conv;
49499 obj_conv.inner = untag_ptr(obj);
49500 obj_conv.is_owned = ptr_is_owned(obj);
49501 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
49502 obj_conv.is_owned = false;
49503 LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv);
49504 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
49505 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
49506 CVec_u8Z_free(ret_var);
49510 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
49511 LDKu8slice ser_ref;
49512 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
49513 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
49514 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
49515 *ret_conv = RoutingFees_read(ser_ref);
49516 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
49517 return tag_ptr(ret_conv, true);
49520 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49521 LDKNodeAnnouncementInfo this_obj_conv;
49522 this_obj_conv.inner = untag_ptr(this_obj);
49523 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49524 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49525 NodeAnnouncementInfo_free(this_obj_conv);
49528 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
49529 LDKNodeAnnouncementInfo this_ptr_conv;
49530 this_ptr_conv.inner = untag_ptr(this_ptr);
49531 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49532 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49533 this_ptr_conv.is_owned = false;
49534 LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv);
49535 int64_t ret_ref = 0;
49536 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49537 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49541 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
49542 LDKNodeAnnouncementInfo this_ptr_conv;
49543 this_ptr_conv.inner = untag_ptr(this_ptr);
49544 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49545 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49546 this_ptr_conv.is_owned = false;
49547 LDKNodeFeatures val_conv;
49548 val_conv.inner = untag_ptr(val);
49549 val_conv.is_owned = ptr_is_owned(val);
49550 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
49551 val_conv = NodeFeatures_clone(&val_conv);
49552 NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv);
49555 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr) {
49556 LDKNodeAnnouncementInfo this_ptr_conv;
49557 this_ptr_conv.inner = untag_ptr(this_ptr);
49558 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49559 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49560 this_ptr_conv.is_owned = false;
49561 int32_t ret_conv = NodeAnnouncementInfo_get_last_update(&this_ptr_conv);
49565 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1last_1update(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
49566 LDKNodeAnnouncementInfo this_ptr_conv;
49567 this_ptr_conv.inner = untag_ptr(this_ptr);
49568 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49569 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49570 this_ptr_conv.is_owned = false;
49571 NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val);
49574 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr) {
49575 LDKNodeAnnouncementInfo this_ptr_conv;
49576 this_ptr_conv.inner = untag_ptr(this_ptr);
49577 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49578 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49579 this_ptr_conv.is_owned = false;
49580 int8_tArray ret_arr = (*env)->NewByteArray(env, 3);
49581 (*env)->SetByteArrayRegion(env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv));
49585 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
49586 LDKNodeAnnouncementInfo this_ptr_conv;
49587 this_ptr_conv.inner = untag_ptr(this_ptr);
49588 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49589 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49590 this_ptr_conv.is_owned = false;
49591 LDKThreeBytes val_ref;
49592 CHECK((*env)->GetArrayLength(env, val) == 3);
49593 (*env)->GetByteArrayRegion(env, val, 0, 3, val_ref.data);
49594 NodeAnnouncementInfo_set_rgb(&this_ptr_conv, val_ref);
49597 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias(JNIEnv *env, jclass clz, int64_t this_ptr) {
49598 LDKNodeAnnouncementInfo this_ptr_conv;
49599 this_ptr_conv.inner = untag_ptr(this_ptr);
49600 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49601 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49602 this_ptr_conv.is_owned = false;
49603 LDKNodeAlias ret_var = NodeAnnouncementInfo_get_alias(&this_ptr_conv);
49604 int64_t ret_ref = 0;
49605 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49606 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49610 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1alias(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
49611 LDKNodeAnnouncementInfo this_ptr_conv;
49612 this_ptr_conv.inner = untag_ptr(this_ptr);
49613 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49614 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49615 this_ptr_conv.is_owned = false;
49616 LDKNodeAlias val_conv;
49617 val_conv.inner = untag_ptr(val);
49618 val_conv.is_owned = ptr_is_owned(val);
49619 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
49620 val_conv = NodeAlias_clone(&val_conv);
49621 NodeAnnouncementInfo_set_alias(&this_ptr_conv, val_conv);
49624 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr) {
49625 LDKNodeAnnouncementInfo this_ptr_conv;
49626 this_ptr_conv.inner = untag_ptr(this_ptr);
49627 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49628 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49629 this_ptr_conv.is_owned = false;
49630 LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv);
49631 int64_t ret_ref = 0;
49632 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49633 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49637 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1announcement_1message(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
49638 LDKNodeAnnouncementInfo this_ptr_conv;
49639 this_ptr_conv.inner = untag_ptr(this_ptr);
49640 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49641 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49642 this_ptr_conv.is_owned = false;
49643 LDKNodeAnnouncement val_conv;
49644 val_conv.inner = untag_ptr(val);
49645 val_conv.is_owned = ptr_is_owned(val);
49646 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
49647 val_conv = NodeAnnouncement_clone(&val_conv);
49648 NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv);
49651 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_t announcement_message_arg) {
49652 LDKNodeFeatures features_arg_conv;
49653 features_arg_conv.inner = untag_ptr(features_arg);
49654 features_arg_conv.is_owned = ptr_is_owned(features_arg);
49655 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
49656 features_arg_conv = NodeFeatures_clone(&features_arg_conv);
49657 LDKThreeBytes rgb_arg_ref;
49658 CHECK((*env)->GetArrayLength(env, rgb_arg) == 3);
49659 (*env)->GetByteArrayRegion(env, rgb_arg, 0, 3, rgb_arg_ref.data);
49660 LDKNodeAlias alias_arg_conv;
49661 alias_arg_conv.inner = untag_ptr(alias_arg);
49662 alias_arg_conv.is_owned = ptr_is_owned(alias_arg);
49663 CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv);
49664 alias_arg_conv = NodeAlias_clone(&alias_arg_conv);
49665 LDKNodeAnnouncement announcement_message_arg_conv;
49666 announcement_message_arg_conv.inner = untag_ptr(announcement_message_arg);
49667 announcement_message_arg_conv.is_owned = ptr_is_owned(announcement_message_arg);
49668 CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv);
49669 announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv);
49670 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_conv, announcement_message_arg_conv);
49671 int64_t ret_ref = 0;
49672 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49673 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49677 static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) {
49678 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg);
49679 int64_t ret_ref = 0;
49680 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49681 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49684 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49685 LDKNodeAnnouncementInfo arg_conv;
49686 arg_conv.inner = untag_ptr(arg);
49687 arg_conv.is_owned = ptr_is_owned(arg);
49688 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
49689 arg_conv.is_owned = false;
49690 int64_t ret_conv = NodeAnnouncementInfo_clone_ptr(&arg_conv);
49694 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49695 LDKNodeAnnouncementInfo orig_conv;
49696 orig_conv.inner = untag_ptr(orig);
49697 orig_conv.is_owned = ptr_is_owned(orig);
49698 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
49699 orig_conv.is_owned = false;
49700 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv);
49701 int64_t ret_ref = 0;
49702 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49703 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49707 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
49708 LDKNodeAnnouncementInfo a_conv;
49709 a_conv.inner = untag_ptr(a);
49710 a_conv.is_owned = ptr_is_owned(a);
49711 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
49712 a_conv.is_owned = false;
49713 LDKNodeAnnouncementInfo b_conv;
49714 b_conv.inner = untag_ptr(b);
49715 b_conv.is_owned = ptr_is_owned(b);
49716 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
49717 b_conv.is_owned = false;
49718 jboolean ret_conv = NodeAnnouncementInfo_eq(&a_conv, &b_conv);
49722 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1addresses(JNIEnv *env, jclass clz, int64_t this_arg) {
49723 LDKNodeAnnouncementInfo this_arg_conv;
49724 this_arg_conv.inner = untag_ptr(this_arg);
49725 this_arg_conv.is_owned = ptr_is_owned(this_arg);
49726 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
49727 this_arg_conv.is_owned = false;
49728 LDKCVec_NetAddressZ ret_var = NodeAnnouncementInfo_addresses(&this_arg_conv);
49729 int64_tArray ret_arr = NULL;
49730 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
49731 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
49732 for (size_t m = 0; m < ret_var.datalen; m++) {
49733 LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
49734 *ret_conv_12_copy = ret_var.data[m];
49735 int64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true);
49736 ret_arr_ptr[m] = ret_conv_12_ref;
49738 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
49739 FREE(ret_var.data);
49743 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
49744 LDKNodeAnnouncementInfo obj_conv;
49745 obj_conv.inner = untag_ptr(obj);
49746 obj_conv.is_owned = ptr_is_owned(obj);
49747 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
49748 obj_conv.is_owned = false;
49749 LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv);
49750 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
49751 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
49752 CVec_u8Z_free(ret_var);
49756 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
49757 LDKu8slice ser_ref;
49758 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
49759 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
49760 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
49761 *ret_conv = NodeAnnouncementInfo_read(ser_ref);
49762 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
49763 return tag_ptr(ret_conv, true);
49766 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49767 LDKNodeAlias this_obj_conv;
49768 this_obj_conv.inner = untag_ptr(this_obj);
49769 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49770 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49771 NodeAlias_free(this_obj_conv);
49774 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
49775 LDKNodeAlias this_ptr_conv;
49776 this_ptr_conv.inner = untag_ptr(this_ptr);
49777 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49778 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49779 this_ptr_conv.is_owned = false;
49780 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
49781 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *NodeAlias_get_a(&this_ptr_conv));
49785 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAlias_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
49786 LDKNodeAlias this_ptr_conv;
49787 this_ptr_conv.inner = untag_ptr(this_ptr);
49788 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49789 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49790 this_ptr_conv.is_owned = false;
49791 LDKThirtyTwoBytes val_ref;
49792 CHECK((*env)->GetArrayLength(env, val) == 32);
49793 (*env)->GetByteArrayRegion(env, val, 0, 32, val_ref.data);
49794 NodeAlias_set_a(&this_ptr_conv, val_ref);
49797 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) {
49798 LDKThirtyTwoBytes a_arg_ref;
49799 CHECK((*env)->GetArrayLength(env, a_arg) == 32);
49800 (*env)->GetByteArrayRegion(env, a_arg, 0, 32, a_arg_ref.data);
49801 LDKNodeAlias ret_var = NodeAlias_new(a_arg_ref);
49802 int64_t ret_ref = 0;
49803 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49804 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49808 static inline uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg) {
49809 LDKNodeAlias ret_var = NodeAlias_clone(arg);
49810 int64_t ret_ref = 0;
49811 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49812 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49815 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49816 LDKNodeAlias arg_conv;
49817 arg_conv.inner = untag_ptr(arg);
49818 arg_conv.is_owned = ptr_is_owned(arg);
49819 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
49820 arg_conv.is_owned = false;
49821 int64_t ret_conv = NodeAlias_clone_ptr(&arg_conv);
49825 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49826 LDKNodeAlias orig_conv;
49827 orig_conv.inner = untag_ptr(orig);
49828 orig_conv.is_owned = ptr_is_owned(orig);
49829 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
49830 orig_conv.is_owned = false;
49831 LDKNodeAlias ret_var = NodeAlias_clone(&orig_conv);
49832 int64_t ret_ref = 0;
49833 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49834 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49838 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAlias_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
49839 LDKNodeAlias a_conv;
49840 a_conv.inner = untag_ptr(a);
49841 a_conv.is_owned = ptr_is_owned(a);
49842 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
49843 a_conv.is_owned = false;
49844 LDKNodeAlias b_conv;
49845 b_conv.inner = untag_ptr(b);
49846 b_conv.is_owned = ptr_is_owned(b);
49847 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
49848 b_conv.is_owned = false;
49849 jboolean ret_conv = NodeAlias_eq(&a_conv, &b_conv);
49853 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1write(JNIEnv *env, jclass clz, int64_t obj) {
49854 LDKNodeAlias obj_conv;
49855 obj_conv.inner = untag_ptr(obj);
49856 obj_conv.is_owned = ptr_is_owned(obj);
49857 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
49858 obj_conv.is_owned = false;
49859 LDKCVec_u8Z ret_var = NodeAlias_write(&obj_conv);
49860 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
49861 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
49862 CVec_u8Z_free(ret_var);
49866 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeAlias_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
49867 LDKu8slice ser_ref;
49868 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
49869 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
49870 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
49871 *ret_conv = NodeAlias_read(ser_ref);
49872 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
49873 return tag_ptr(ret_conv, true);
49876 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
49877 LDKNodeInfo this_obj_conv;
49878 this_obj_conv.inner = untag_ptr(this_obj);
49879 this_obj_conv.is_owned = ptr_is_owned(this_obj);
49880 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
49881 NodeInfo_free(this_obj_conv);
49884 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
49885 LDKNodeInfo this_ptr_conv;
49886 this_ptr_conv.inner = untag_ptr(this_ptr);
49887 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49888 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49889 this_ptr_conv.is_owned = false;
49890 LDKCVec_u64Z ret_var = NodeInfo_get_channels(&this_ptr_conv);
49891 int64_tArray ret_arr = NULL;
49892 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
49893 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
49894 for (size_t g = 0; g < ret_var.datalen; g++) {
49895 int64_t ret_conv_6_conv = ret_var.data[g];
49896 ret_arr_ptr[g] = ret_conv_6_conv;
49898 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
49899 FREE(ret_var.data);
49903 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
49904 LDKNodeInfo this_ptr_conv;
49905 this_ptr_conv.inner = untag_ptr(this_ptr);
49906 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49907 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49908 this_ptr_conv.is_owned = false;
49909 LDKCVec_u64Z val_constr;
49910 val_constr.datalen = (*env)->GetArrayLength(env, val);
49911 if (val_constr.datalen > 0)
49912 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
49914 val_constr.data = NULL;
49915 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
49916 for (size_t g = 0; g < val_constr.datalen; g++) {
49917 int64_t val_conv_6 = val_vals[g];
49918 val_constr.data[g] = val_conv_6;
49920 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
49921 NodeInfo_set_channels(&this_ptr_conv, val_constr);
49924 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info(JNIEnv *env, jclass clz, int64_t this_ptr) {
49925 LDKNodeInfo this_ptr_conv;
49926 this_ptr_conv.inner = untag_ptr(this_ptr);
49927 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49928 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49929 this_ptr_conv.is_owned = false;
49930 LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv);
49931 int64_t ret_ref = 0;
49932 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49933 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49937 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
49938 LDKNodeInfo this_ptr_conv;
49939 this_ptr_conv.inner = untag_ptr(this_ptr);
49940 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
49941 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
49942 this_ptr_conv.is_owned = false;
49943 LDKNodeAnnouncementInfo val_conv;
49944 val_conv.inner = untag_ptr(val);
49945 val_conv.is_owned = ptr_is_owned(val);
49946 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
49947 val_conv = NodeAnnouncementInfo_clone(&val_conv);
49948 NodeInfo_set_announcement_info(&this_ptr_conv, val_conv);
49951 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1new(JNIEnv *env, jclass clz, int64_tArray channels_arg, int64_t announcement_info_arg) {
49952 LDKCVec_u64Z channels_arg_constr;
49953 channels_arg_constr.datalen = (*env)->GetArrayLength(env, channels_arg);
49954 if (channels_arg_constr.datalen > 0)
49955 channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
49957 channels_arg_constr.data = NULL;
49958 int64_t* channels_arg_vals = (*env)->GetLongArrayElements (env, channels_arg, NULL);
49959 for (size_t g = 0; g < channels_arg_constr.datalen; g++) {
49960 int64_t channels_arg_conv_6 = channels_arg_vals[g];
49961 channels_arg_constr.data[g] = channels_arg_conv_6;
49963 (*env)->ReleaseLongArrayElements(env, channels_arg, channels_arg_vals, 0);
49964 LDKNodeAnnouncementInfo announcement_info_arg_conv;
49965 announcement_info_arg_conv.inner = untag_ptr(announcement_info_arg);
49966 announcement_info_arg_conv.is_owned = ptr_is_owned(announcement_info_arg);
49967 CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv);
49968 announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv);
49969 LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, announcement_info_arg_conv);
49970 int64_t ret_ref = 0;
49971 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49972 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49976 static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) {
49977 LDKNodeInfo ret_var = NodeInfo_clone(arg);
49978 int64_t ret_ref = 0;
49979 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
49980 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
49983 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
49984 LDKNodeInfo arg_conv;
49985 arg_conv.inner = untag_ptr(arg);
49986 arg_conv.is_owned = ptr_is_owned(arg);
49987 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
49988 arg_conv.is_owned = false;
49989 int64_t ret_conv = NodeInfo_clone_ptr(&arg_conv);
49993 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone(JNIEnv *env, jclass clz, int64_t orig) {
49994 LDKNodeInfo orig_conv;
49995 orig_conv.inner = untag_ptr(orig);
49996 orig_conv.is_owned = ptr_is_owned(orig);
49997 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
49998 orig_conv.is_owned = false;
49999 LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv);
50000 int64_t ret_ref = 0;
50001 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50002 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50006 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
50007 LDKNodeInfo a_conv;
50008 a_conv.inner = untag_ptr(a);
50009 a_conv.is_owned = ptr_is_owned(a);
50010 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
50011 a_conv.is_owned = false;
50012 LDKNodeInfo b_conv;
50013 b_conv.inner = untag_ptr(b);
50014 b_conv.is_owned = ptr_is_owned(b);
50015 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
50016 b_conv.is_owned = false;
50017 jboolean ret_conv = NodeInfo_eq(&a_conv, &b_conv);
50021 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
50022 LDKNodeInfo obj_conv;
50023 obj_conv.inner = untag_ptr(obj);
50024 obj_conv.is_owned = ptr_is_owned(obj);
50025 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
50026 obj_conv.is_owned = false;
50027 LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv);
50028 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
50029 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
50030 CVec_u8Z_free(ret_var);
50034 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
50035 LDKu8slice ser_ref;
50036 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
50037 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
50038 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
50039 *ret_conv = NodeInfo_read(ser_ref);
50040 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
50041 return tag_ptr(ret_conv, true);
50044 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv *env, jclass clz, int64_t obj) {
50045 LDKNetworkGraph obj_conv;
50046 obj_conv.inner = untag_ptr(obj);
50047 obj_conv.is_owned = ptr_is_owned(obj);
50048 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
50049 obj_conv.is_owned = false;
50050 LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv);
50051 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
50052 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
50053 CVec_u8Z_free(ret_var);
50057 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) {
50058 LDKu8slice ser_ref;
50059 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
50060 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
50061 void* arg_ptr = untag_ptr(arg);
50062 CHECK_ACCESS(arg_ptr);
50063 LDKLogger arg_conv = *(LDKLogger*)(arg_ptr);
50064 if (arg_conv.free == LDKLogger_JCalls_free) {
50065 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
50066 LDKLogger_JCalls_cloned(&arg_conv);
50068 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
50069 *ret_conv = NetworkGraph_read(ser_ref, arg_conv);
50070 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
50071 return tag_ptr(ret_conv, true);
50074 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv *env, jclass clz, jclass network, int64_t logger) {
50075 LDKNetwork network_conv = LDKNetwork_from_java(env, network);
50076 void* logger_ptr = untag_ptr(logger);
50077 CHECK_ACCESS(logger_ptr);
50078 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
50079 if (logger_conv.free == LDKLogger_JCalls_free) {
50080 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
50081 LDKLogger_JCalls_cloned(&logger_conv);
50083 LDKNetworkGraph ret_var = NetworkGraph_new(network_conv, logger_conv);
50084 int64_t ret_ref = 0;
50085 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50086 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50090 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read_1only(JNIEnv *env, jclass clz, int64_t this_arg) {
50091 LDKNetworkGraph this_arg_conv;
50092 this_arg_conv.inner = untag_ptr(this_arg);
50093 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50094 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50095 this_arg_conv.is_owned = false;
50096 LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv);
50097 int64_t ret_ref = 0;
50098 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50099 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50103 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1get_1last_1rapid_1gossip_1sync_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg) {
50104 LDKNetworkGraph this_arg_conv;
50105 this_arg_conv.inner = untag_ptr(this_arg);
50106 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50107 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50108 this_arg_conv.is_owned = false;
50109 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
50110 *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv);
50111 int64_t ret_ref = tag_ptr(ret_copy, true);
50115 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) {
50116 LDKNetworkGraph this_arg_conv;
50117 this_arg_conv.inner = untag_ptr(this_arg);
50118 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50119 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50120 this_arg_conv.is_owned = false;
50121 NetworkGraph_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp);
50124 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) {
50125 LDKNetworkGraph this_arg_conv;
50126 this_arg_conv.inner = untag_ptr(this_arg);
50127 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50128 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50129 this_arg_conv.is_owned = false;
50130 LDKNodeAnnouncement msg_conv;
50131 msg_conv.inner = untag_ptr(msg);
50132 msg_conv.is_owned = ptr_is_owned(msg);
50133 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
50134 msg_conv.is_owned = false;
50135 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
50136 *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv);
50137 return tag_ptr(ret_conv, true);
50140 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) {
50141 LDKNetworkGraph this_arg_conv;
50142 this_arg_conv.inner = untag_ptr(this_arg);
50143 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50144 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50145 this_arg_conv.is_owned = false;
50146 LDKUnsignedNodeAnnouncement msg_conv;
50147 msg_conv.inner = untag_ptr(msg);
50148 msg_conv.is_owned = ptr_is_owned(msg);
50149 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
50150 msg_conv.is_owned = false;
50151 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
50152 *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv);
50153 return tag_ptr(ret_conv, true);
50156 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) {
50157 LDKNetworkGraph this_arg_conv;
50158 this_arg_conv.inner = untag_ptr(this_arg);
50159 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50160 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50161 this_arg_conv.is_owned = false;
50162 LDKChannelAnnouncement msg_conv;
50163 msg_conv.inner = untag_ptr(msg);
50164 msg_conv.is_owned = ptr_is_owned(msg);
50165 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
50166 msg_conv.is_owned = false;
50167 void* utxo_lookup_ptr = untag_ptr(utxo_lookup);
50168 CHECK_ACCESS(utxo_lookup_ptr);
50169 LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr);
50170 // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ
50171 if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) {
50172 // Manually implement clone for Java trait instances
50173 if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) {
50174 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
50175 LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some);
50178 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
50179 *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv);
50180 return tag_ptr(ret_conv, true);
50183 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) {
50184 LDKNetworkGraph this_arg_conv;
50185 this_arg_conv.inner = untag_ptr(this_arg);
50186 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50187 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50188 this_arg_conv.is_owned = false;
50189 LDKUnsignedChannelAnnouncement msg_conv;
50190 msg_conv.inner = untag_ptr(msg);
50191 msg_conv.is_owned = ptr_is_owned(msg);
50192 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
50193 msg_conv.is_owned = false;
50194 void* utxo_lookup_ptr = untag_ptr(utxo_lookup);
50195 CHECK_ACCESS(utxo_lookup_ptr);
50196 LDKCOption_UtxoLookupZ utxo_lookup_conv = *(LDKCOption_UtxoLookupZ*)(utxo_lookup_ptr);
50197 // WARNING: we may need a move here but no clone is available for LDKCOption_UtxoLookupZ
50198 if (utxo_lookup_conv.tag == LDKCOption_UtxoLookupZ_Some) {
50199 // Manually implement clone for Java trait instances
50200 if (utxo_lookup_conv.some.free == LDKUtxoLookup_JCalls_free) {
50201 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
50202 LDKUtxoLookup_JCalls_cloned(&utxo_lookup_conv.some);
50205 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
50206 *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, utxo_lookup_conv);
50207 return tag_ptr(ret_conv, true);
50210 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) {
50211 LDKNetworkGraph this_arg_conv;
50212 this_arg_conv.inner = untag_ptr(this_arg);
50213 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50214 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50215 this_arg_conv.is_owned = false;
50216 LDKChannelFeatures features_conv;
50217 features_conv.inner = untag_ptr(features);
50218 features_conv.is_owned = ptr_is_owned(features);
50219 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv);
50220 features_conv = ChannelFeatures_clone(&features_conv);
50221 LDKPublicKey node_id_1_ref;
50222 CHECK((*env)->GetArrayLength(env, node_id_1) == 33);
50223 (*env)->GetByteArrayRegion(env, node_id_1, 0, 33, node_id_1_ref.compressed_form);
50224 LDKPublicKey node_id_2_ref;
50225 CHECK((*env)->GetArrayLength(env, node_id_2) == 33);
50226 (*env)->GetByteArrayRegion(env, node_id_2, 0, 33, node_id_2_ref.compressed_form);
50227 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
50228 *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);
50229 return tag_ptr(ret_conv, true);
50232 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1channel_1failed_1permanent(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id) {
50233 LDKNetworkGraph this_arg_conv;
50234 this_arg_conv.inner = untag_ptr(this_arg);
50235 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50236 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50237 this_arg_conv.is_owned = false;
50238 NetworkGraph_channel_failed_permanent(&this_arg_conv, short_channel_id);
50241 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1node_1failed_1permanent(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray node_id) {
50242 LDKNetworkGraph this_arg_conv;
50243 this_arg_conv.inner = untag_ptr(this_arg);
50244 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50245 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50246 this_arg_conv.is_owned = false;
50247 LDKPublicKey node_id_ref;
50248 CHECK((*env)->GetArrayLength(env, node_id) == 33);
50249 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
50250 NetworkGraph_node_failed_permanent(&this_arg_conv, node_id_ref);
50253 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking(JNIEnv *env, jclass clz, int64_t this_arg) {
50254 LDKNetworkGraph this_arg_conv;
50255 this_arg_conv.inner = untag_ptr(this_arg);
50256 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50257 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50258 this_arg_conv.is_owned = false;
50259 NetworkGraph_remove_stale_channels_and_tracking(&this_arg_conv);
50262 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) {
50263 LDKNetworkGraph this_arg_conv;
50264 this_arg_conv.inner = untag_ptr(this_arg);
50265 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50266 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50267 this_arg_conv.is_owned = false;
50268 NetworkGraph_remove_stale_channels_and_tracking_with_time(&this_arg_conv, current_time_unix);
50271 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
50272 LDKNetworkGraph this_arg_conv;
50273 this_arg_conv.inner = untag_ptr(this_arg);
50274 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50276 this_arg_conv.is_owned = false;
50277 LDKChannelUpdate msg_conv;
50278 msg_conv.inner = untag_ptr(msg);
50279 msg_conv.is_owned = ptr_is_owned(msg);
50280 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
50281 msg_conv.is_owned = false;
50282 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
50283 *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv);
50284 return tag_ptr(ret_conv, true);
50287 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel_1unsigned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
50288 LDKNetworkGraph this_arg_conv;
50289 this_arg_conv.inner = untag_ptr(this_arg);
50290 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50291 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50292 this_arg_conv.is_owned = false;
50293 LDKUnsignedChannelUpdate msg_conv;
50294 msg_conv.inner = untag_ptr(msg);
50295 msg_conv.is_owned = ptr_is_owned(msg);
50296 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
50297 msg_conv.is_owned = false;
50298 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
50299 *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv);
50300 return tag_ptr(ret_conv, true);
50303 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t short_channel_id) {
50304 LDKReadOnlyNetworkGraph this_arg_conv;
50305 this_arg_conv.inner = untag_ptr(this_arg);
50306 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50307 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50308 this_arg_conv.is_owned = false;
50309 LDKChannelInfo ret_var = ReadOnlyNetworkGraph_channel(&this_arg_conv, short_channel_id);
50310 int64_t ret_ref = 0;
50311 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50312 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50316 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1channels(JNIEnv *env, jclass clz, int64_t this_arg) {
50317 LDKReadOnlyNetworkGraph this_arg_conv;
50318 this_arg_conv.inner = untag_ptr(this_arg);
50319 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50320 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50321 this_arg_conv.is_owned = false;
50322 LDKCVec_u64Z ret_var = ReadOnlyNetworkGraph_list_channels(&this_arg_conv);
50323 int64_tArray ret_arr = NULL;
50324 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
50325 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
50326 for (size_t g = 0; g < ret_var.datalen; g++) {
50327 int64_t ret_conv_6_conv = ret_var.data[g];
50328 ret_arr_ptr[g] = ret_conv_6_conv;
50330 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
50331 FREE(ret_var.data);
50335 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1node(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) {
50336 LDKReadOnlyNetworkGraph this_arg_conv;
50337 this_arg_conv.inner = untag_ptr(this_arg);
50338 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50339 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50340 this_arg_conv.is_owned = false;
50341 LDKNodeId node_id_conv;
50342 node_id_conv.inner = untag_ptr(node_id);
50343 node_id_conv.is_owned = ptr_is_owned(node_id);
50344 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
50345 node_id_conv.is_owned = false;
50346 LDKNodeInfo ret_var = ReadOnlyNetworkGraph_node(&this_arg_conv, &node_id_conv);
50347 int64_t ret_ref = 0;
50348 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50349 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50353 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1list_1nodes(JNIEnv *env, jclass clz, int64_t this_arg) {
50354 LDKReadOnlyNetworkGraph this_arg_conv;
50355 this_arg_conv.inner = untag_ptr(this_arg);
50356 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50357 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50358 this_arg_conv.is_owned = false;
50359 LDKCVec_NodeIdZ ret_var = ReadOnlyNetworkGraph_list_nodes(&this_arg_conv);
50360 int64_tArray ret_arr = NULL;
50361 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
50362 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
50363 for (size_t i = 0; i < ret_var.datalen; i++) {
50364 LDKNodeId ret_conv_8_var = ret_var.data[i];
50365 int64_t ret_conv_8_ref = 0;
50366 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_8_var);
50367 ret_conv_8_ref = tag_ptr(ret_conv_8_var.inner, ret_conv_8_var.is_owned);
50368 ret_arr_ptr[i] = ret_conv_8_ref;
50370 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
50371 FREE(ret_var.data);
50375 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1get_1addresses(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey) {
50376 LDKReadOnlyNetworkGraph this_arg_conv;
50377 this_arg_conv.inner = untag_ptr(this_arg);
50378 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50379 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50380 this_arg_conv.is_owned = false;
50381 LDKPublicKey pubkey_ref;
50382 CHECK((*env)->GetArrayLength(env, pubkey) == 33);
50383 (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form);
50384 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
50385 *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref);
50386 int64_t ret_ref = tag_ptr(ret_copy, true);
50390 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
50391 LDKDefaultRouter this_obj_conv;
50392 this_obj_conv.inner = untag_ptr(this_obj);
50393 this_obj_conv.is_owned = ptr_is_owned(this_obj);
50394 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
50395 DefaultRouter_free(this_obj_conv);
50398 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) {
50399 LDKNetworkGraph network_graph_conv;
50400 network_graph_conv.inner = untag_ptr(network_graph);
50401 network_graph_conv.is_owned = ptr_is_owned(network_graph);
50402 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
50403 network_graph_conv.is_owned = false;
50404 void* logger_ptr = untag_ptr(logger);
50405 CHECK_ACCESS(logger_ptr);
50406 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
50407 if (logger_conv.free == LDKLogger_JCalls_free) {
50408 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
50409 LDKLogger_JCalls_cloned(&logger_conv);
50411 LDKThirtyTwoBytes random_seed_bytes_ref;
50412 CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32);
50413 (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_ref.data);
50414 void* scorer_ptr = untag_ptr(scorer);
50415 CHECK_ACCESS(scorer_ptr);
50416 LDKLockableScore scorer_conv = *(LDKLockableScore*)(scorer_ptr);
50417 if (scorer_conv.free == LDKLockableScore_JCalls_free) {
50418 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
50419 LDKLockableScore_JCalls_cloned(&scorer_conv);
50421 LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, random_seed_bytes_ref, scorer_conv);
50422 int64_t ret_ref = 0;
50423 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50424 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50428 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router(JNIEnv *env, jclass clz, int64_t this_arg) {
50429 LDKDefaultRouter this_arg_conv;
50430 this_arg_conv.inner = untag_ptr(this_arg);
50431 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50432 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50433 this_arg_conv.is_owned = false;
50434 LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter");
50435 *ret_ret = DefaultRouter_as_Router(&this_arg_conv);
50436 return tag_ptr(ret_ret, true);
50439 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
50440 if (!ptr_is_owned(this_ptr)) return;
50441 void* this_ptr_ptr = untag_ptr(this_ptr);
50442 CHECK_ACCESS(this_ptr_ptr);
50443 LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr);
50444 FREE(untag_ptr(this_ptr));
50445 Router_free(this_ptr_conv);
50448 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
50449 LDKScorerAccountingForInFlightHtlcs this_obj_conv;
50450 this_obj_conv.inner = untag_ptr(this_obj);
50451 this_obj_conv.is_owned = ptr_is_owned(this_obj);
50452 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
50453 ScorerAccountingForInFlightHtlcs_free(this_obj_conv);
50456 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1new(JNIEnv *env, jclass clz, int64_t scorer, int64_t inflight_htlcs) {
50457 void* scorer_ptr = untag_ptr(scorer);
50458 CHECK_ACCESS(scorer_ptr);
50459 LDKScore scorer_conv = *(LDKScore*)(scorer_ptr);
50460 if (scorer_conv.free == LDKScore_JCalls_free) {
50461 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
50462 LDKScore_JCalls_cloned(&scorer_conv);
50464 LDKInFlightHtlcs inflight_htlcs_conv;
50465 inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs);
50466 inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs);
50467 CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv);
50468 inflight_htlcs_conv.is_owned = false;
50469 LDKScorerAccountingForInFlightHtlcs ret_var = ScorerAccountingForInFlightHtlcs_new(scorer_conv, &inflight_htlcs_conv);
50470 int64_t ret_ref = 0;
50471 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50472 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50476 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1write(JNIEnv *env, jclass clz, int64_t obj) {
50477 LDKScorerAccountingForInFlightHtlcs obj_conv;
50478 obj_conv.inner = untag_ptr(obj);
50479 obj_conv.is_owned = ptr_is_owned(obj);
50480 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
50481 obj_conv.is_owned = false;
50482 LDKCVec_u8Z ret_var = ScorerAccountingForInFlightHtlcs_write(&obj_conv);
50483 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
50484 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
50485 CVec_u8Z_free(ret_var);
50489 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) {
50490 LDKScorerAccountingForInFlightHtlcs this_arg_conv;
50491 this_arg_conv.inner = untag_ptr(this_arg);
50492 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50493 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50494 this_arg_conv.is_owned = false;
50495 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
50496 *ret_ret = ScorerAccountingForInFlightHtlcs_as_Score(&this_arg_conv);
50497 return tag_ptr(ret_ret, true);
50500 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
50501 LDKInFlightHtlcs this_obj_conv;
50502 this_obj_conv.inner = untag_ptr(this_obj);
50503 this_obj_conv.is_owned = ptr_is_owned(this_obj);
50504 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
50505 InFlightHtlcs_free(this_obj_conv);
50508 static inline uint64_t InFlightHtlcs_clone_ptr(LDKInFlightHtlcs *NONNULL_PTR arg) {
50509 LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(arg);
50510 int64_t ret_ref = 0;
50511 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50512 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50515 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
50516 LDKInFlightHtlcs arg_conv;
50517 arg_conv.inner = untag_ptr(arg);
50518 arg_conv.is_owned = ptr_is_owned(arg);
50519 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
50520 arg_conv.is_owned = false;
50521 int64_t ret_conv = InFlightHtlcs_clone_ptr(&arg_conv);
50525 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone(JNIEnv *env, jclass clz, int64_t orig) {
50526 LDKInFlightHtlcs orig_conv;
50527 orig_conv.inner = untag_ptr(orig);
50528 orig_conv.is_owned = ptr_is_owned(orig);
50529 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
50530 orig_conv.is_owned = false;
50531 LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(&orig_conv);
50532 int64_t ret_ref = 0;
50533 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50534 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50538 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1new(JNIEnv *env, jclass clz) {
50539 LDKInFlightHtlcs ret_var = InFlightHtlcs_new();
50540 int64_t ret_ref = 0;
50541 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50542 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50546 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1process_1path(JNIEnv *env, jclass clz, int64_t this_arg, int64_t path, int8_tArray payer_node_id) {
50547 LDKInFlightHtlcs this_arg_conv;
50548 this_arg_conv.inner = untag_ptr(this_arg);
50549 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50550 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50551 this_arg_conv.is_owned = false;
50553 path_conv.inner = untag_ptr(path);
50554 path_conv.is_owned = ptr_is_owned(path);
50555 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv);
50556 path_conv.is_owned = false;
50557 LDKPublicKey payer_node_id_ref;
50558 CHECK((*env)->GetArrayLength(env, payer_node_id) == 33);
50559 (*env)->GetByteArrayRegion(env, payer_node_id, 0, 33, payer_node_id_ref.compressed_form);
50560 InFlightHtlcs_process_path(&this_arg_conv, &path_conv, payer_node_id_ref);
50563 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) {
50564 LDKInFlightHtlcs this_arg_conv;
50565 this_arg_conv.inner = untag_ptr(this_arg);
50566 this_arg_conv.is_owned = ptr_is_owned(this_arg);
50567 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
50568 this_arg_conv.is_owned = false;
50569 LDKNodeId source_conv;
50570 source_conv.inner = untag_ptr(source);
50571 source_conv.is_owned = ptr_is_owned(source);
50572 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv);
50573 source_conv.is_owned = false;
50574 LDKNodeId target_conv;
50575 target_conv.inner = untag_ptr(target);
50576 target_conv.is_owned = ptr_is_owned(target);
50577 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
50578 target_conv.is_owned = false;
50579 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
50580 *ret_copy = InFlightHtlcs_used_liquidity_msat(&this_arg_conv, &source_conv, &target_conv, channel_scid);
50581 int64_t ret_ref = tag_ptr(ret_copy, true);
50585 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1write(JNIEnv *env, jclass clz, int64_t obj) {
50586 LDKInFlightHtlcs obj_conv;
50587 obj_conv.inner = untag_ptr(obj);
50588 obj_conv.is_owned = ptr_is_owned(obj);
50589 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
50590 obj_conv.is_owned = false;
50591 LDKCVec_u8Z ret_var = InFlightHtlcs_write(&obj_conv);
50592 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
50593 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
50594 CVec_u8Z_free(ret_var);
50598 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
50599 LDKu8slice ser_ref;
50600 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
50601 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
50602 LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
50603 *ret_conv = InFlightHtlcs_read(ser_ref);
50604 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
50605 return tag_ptr(ret_conv, true);
50608 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
50609 LDKRouteHop this_obj_conv;
50610 this_obj_conv.inner = untag_ptr(this_obj);
50611 this_obj_conv.is_owned = ptr_is_owned(this_obj);
50612 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
50613 RouteHop_free(this_obj_conv);
50616 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
50617 LDKRouteHop this_ptr_conv;
50618 this_ptr_conv.inner = untag_ptr(this_ptr);
50619 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50620 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50621 this_ptr_conv.is_owned = false;
50622 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
50623 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHop_get_pubkey(&this_ptr_conv).compressed_form);
50627 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
50628 LDKRouteHop this_ptr_conv;
50629 this_ptr_conv.inner = untag_ptr(this_ptr);
50630 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50631 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50632 this_ptr_conv.is_owned = false;
50633 LDKPublicKey val_ref;
50634 CHECK((*env)->GetArrayLength(env, val) == 33);
50635 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
50636 RouteHop_set_pubkey(&this_ptr_conv, val_ref);
50639 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
50640 LDKRouteHop this_ptr_conv;
50641 this_ptr_conv.inner = untag_ptr(this_ptr);
50642 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50643 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50644 this_ptr_conv.is_owned = false;
50645 LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv);
50646 int64_t ret_ref = 0;
50647 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50648 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50652 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
50653 LDKRouteHop this_ptr_conv;
50654 this_ptr_conv.inner = untag_ptr(this_ptr);
50655 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50656 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50657 this_ptr_conv.is_owned = false;
50658 LDKNodeFeatures val_conv;
50659 val_conv.inner = untag_ptr(val);
50660 val_conv.is_owned = ptr_is_owned(val);
50661 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
50662 val_conv = NodeFeatures_clone(&val_conv);
50663 RouteHop_set_node_features(&this_ptr_conv, val_conv);
50666 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
50667 LDKRouteHop this_ptr_conv;
50668 this_ptr_conv.inner = untag_ptr(this_ptr);
50669 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50670 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50671 this_ptr_conv.is_owned = false;
50672 int64_t ret_conv = RouteHop_get_short_channel_id(&this_ptr_conv);
50676 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
50677 LDKRouteHop this_ptr_conv;
50678 this_ptr_conv.inner = untag_ptr(this_ptr);
50679 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50680 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50681 this_ptr_conv.is_owned = false;
50682 RouteHop_set_short_channel_id(&this_ptr_conv, val);
50685 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
50686 LDKRouteHop this_ptr_conv;
50687 this_ptr_conv.inner = untag_ptr(this_ptr);
50688 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50689 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50690 this_ptr_conv.is_owned = false;
50691 LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv);
50692 int64_t ret_ref = 0;
50693 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50694 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50698 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
50699 LDKRouteHop this_ptr_conv;
50700 this_ptr_conv.inner = untag_ptr(this_ptr);
50701 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50702 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50703 this_ptr_conv.is_owned = false;
50704 LDKChannelFeatures val_conv;
50705 val_conv.inner = untag_ptr(val);
50706 val_conv.is_owned = ptr_is_owned(val);
50707 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
50708 val_conv = ChannelFeatures_clone(&val_conv);
50709 RouteHop_set_channel_features(&this_ptr_conv, val_conv);
50712 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
50713 LDKRouteHop this_ptr_conv;
50714 this_ptr_conv.inner = untag_ptr(this_ptr);
50715 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50716 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50717 this_ptr_conv.is_owned = false;
50718 int64_t ret_conv = RouteHop_get_fee_msat(&this_ptr_conv);
50722 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
50723 LDKRouteHop this_ptr_conv;
50724 this_ptr_conv.inner = untag_ptr(this_ptr);
50725 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50726 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50727 this_ptr_conv.is_owned = false;
50728 RouteHop_set_fee_msat(&this_ptr_conv, val);
50731 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
50732 LDKRouteHop this_ptr_conv;
50733 this_ptr_conv.inner = untag_ptr(this_ptr);
50734 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50735 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50736 this_ptr_conv.is_owned = false;
50737 int32_t ret_conv = RouteHop_get_cltv_expiry_delta(&this_ptr_conv);
50741 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
50742 LDKRouteHop this_ptr_conv;
50743 this_ptr_conv.inner = untag_ptr(this_ptr);
50744 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50745 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50746 this_ptr_conv.is_owned = false;
50747 RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val);
50750 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) {
50751 LDKPublicKey pubkey_arg_ref;
50752 CHECK((*env)->GetArrayLength(env, pubkey_arg) == 33);
50753 (*env)->GetByteArrayRegion(env, pubkey_arg, 0, 33, pubkey_arg_ref.compressed_form);
50754 LDKNodeFeatures node_features_arg_conv;
50755 node_features_arg_conv.inner = untag_ptr(node_features_arg);
50756 node_features_arg_conv.is_owned = ptr_is_owned(node_features_arg);
50757 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv);
50758 node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv);
50759 LDKChannelFeatures channel_features_arg_conv;
50760 channel_features_arg_conv.inner = untag_ptr(channel_features_arg);
50761 channel_features_arg_conv.is_owned = ptr_is_owned(channel_features_arg);
50762 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv);
50763 channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv);
50764 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);
50765 int64_t ret_ref = 0;
50766 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50767 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50771 static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) {
50772 LDKRouteHop ret_var = RouteHop_clone(arg);
50773 int64_t ret_ref = 0;
50774 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50775 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50778 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
50779 LDKRouteHop arg_conv;
50780 arg_conv.inner = untag_ptr(arg);
50781 arg_conv.is_owned = ptr_is_owned(arg);
50782 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
50783 arg_conv.is_owned = false;
50784 int64_t ret_conv = RouteHop_clone_ptr(&arg_conv);
50788 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1clone(JNIEnv *env, jclass clz, int64_t orig) {
50789 LDKRouteHop orig_conv;
50790 orig_conv.inner = untag_ptr(orig);
50791 orig_conv.is_owned = ptr_is_owned(orig);
50792 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
50793 orig_conv.is_owned = false;
50794 LDKRouteHop ret_var = RouteHop_clone(&orig_conv);
50795 int64_t ret_ref = 0;
50796 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50797 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50801 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1hash(JNIEnv *env, jclass clz, int64_t o) {
50802 LDKRouteHop o_conv;
50803 o_conv.inner = untag_ptr(o);
50804 o_conv.is_owned = ptr_is_owned(o);
50805 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
50806 o_conv.is_owned = false;
50807 int64_t ret_conv = RouteHop_hash(&o_conv);
50811 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
50812 LDKRouteHop a_conv;
50813 a_conv.inner = untag_ptr(a);
50814 a_conv.is_owned = ptr_is_owned(a);
50815 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
50816 a_conv.is_owned = false;
50817 LDKRouteHop b_conv;
50818 b_conv.inner = untag_ptr(b);
50819 b_conv.is_owned = ptr_is_owned(b);
50820 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
50821 b_conv.is_owned = false;
50822 jboolean ret_conv = RouteHop_eq(&a_conv, &b_conv);
50826 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHop_1write(JNIEnv *env, jclass clz, int64_t obj) {
50827 LDKRouteHop obj_conv;
50828 obj_conv.inner = untag_ptr(obj);
50829 obj_conv.is_owned = ptr_is_owned(obj);
50830 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
50831 obj_conv.is_owned = false;
50832 LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv);
50833 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
50834 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
50835 CVec_u8Z_free(ret_var);
50839 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
50840 LDKu8slice ser_ref;
50841 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
50842 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
50843 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
50844 *ret_conv = RouteHop_read(ser_ref);
50845 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
50846 return tag_ptr(ret_conv, true);
50849 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
50850 LDKBlindedTail this_obj_conv;
50851 this_obj_conv.inner = untag_ptr(this_obj);
50852 this_obj_conv.is_owned = ptr_is_owned(this_obj);
50853 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
50854 BlindedTail_free(this_obj_conv);
50857 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1hops(JNIEnv *env, jclass clz, int64_t this_ptr) {
50858 LDKBlindedTail this_ptr_conv;
50859 this_ptr_conv.inner = untag_ptr(this_ptr);
50860 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50861 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50862 this_ptr_conv.is_owned = false;
50863 LDKCVec_BlindedHopZ ret_var = BlindedTail_get_hops(&this_ptr_conv);
50864 int64_tArray ret_arr = NULL;
50865 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
50866 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
50867 for (size_t m = 0; m < ret_var.datalen; m++) {
50868 LDKBlindedHop ret_conv_12_var = ret_var.data[m];
50869 int64_t ret_conv_12_ref = 0;
50870 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_var);
50871 ret_conv_12_ref = tag_ptr(ret_conv_12_var.inner, ret_conv_12_var.is_owned);
50872 ret_arr_ptr[m] = ret_conv_12_ref;
50874 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
50875 FREE(ret_var.data);
50879 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1hops(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
50880 LDKBlindedTail this_ptr_conv;
50881 this_ptr_conv.inner = untag_ptr(this_ptr);
50882 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50883 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50884 this_ptr_conv.is_owned = false;
50885 LDKCVec_BlindedHopZ val_constr;
50886 val_constr.datalen = (*env)->GetArrayLength(env, val);
50887 if (val_constr.datalen > 0)
50888 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements");
50890 val_constr.data = NULL;
50891 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
50892 for (size_t m = 0; m < val_constr.datalen; m++) {
50893 int64_t val_conv_12 = val_vals[m];
50894 LDKBlindedHop val_conv_12_conv;
50895 val_conv_12_conv.inner = untag_ptr(val_conv_12);
50896 val_conv_12_conv.is_owned = ptr_is_owned(val_conv_12);
50897 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv);
50898 val_conv_12_conv = BlindedHop_clone(&val_conv_12_conv);
50899 val_constr.data[m] = val_conv_12_conv;
50901 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
50902 BlindedTail_set_hops(&this_ptr_conv, val_constr);
50905 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr) {
50906 LDKBlindedTail this_ptr_conv;
50907 this_ptr_conv.inner = untag_ptr(this_ptr);
50908 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50909 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50910 this_ptr_conv.is_owned = false;
50911 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
50912 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, BlindedTail_get_blinding_point(&this_ptr_conv).compressed_form);
50916 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1blinding_1point(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
50917 LDKBlindedTail this_ptr_conv;
50918 this_ptr_conv.inner = untag_ptr(this_ptr);
50919 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50920 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50921 this_ptr_conv.is_owned = false;
50922 LDKPublicKey val_ref;
50923 CHECK((*env)->GetArrayLength(env, val) == 33);
50924 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
50925 BlindedTail_set_blinding_point(&this_ptr_conv, val_ref);
50928 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1excess_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
50929 LDKBlindedTail this_ptr_conv;
50930 this_ptr_conv.inner = untag_ptr(this_ptr);
50931 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50932 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50933 this_ptr_conv.is_owned = false;
50934 int32_t ret_conv = BlindedTail_get_excess_final_cltv_expiry_delta(&this_ptr_conv);
50938 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1excess_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int32_t val) {
50939 LDKBlindedTail this_ptr_conv;
50940 this_ptr_conv.inner = untag_ptr(this_ptr);
50941 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50942 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50943 this_ptr_conv.is_owned = false;
50944 BlindedTail_set_excess_final_cltv_expiry_delta(&this_ptr_conv, val);
50947 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1get_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
50948 LDKBlindedTail this_ptr_conv;
50949 this_ptr_conv.inner = untag_ptr(this_ptr);
50950 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50951 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50952 this_ptr_conv.is_owned = false;
50953 int64_t ret_conv = BlindedTail_get_final_value_msat(&this_ptr_conv);
50957 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedTail_1set_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
50958 LDKBlindedTail this_ptr_conv;
50959 this_ptr_conv.inner = untag_ptr(this_ptr);
50960 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
50961 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
50962 this_ptr_conv.is_owned = false;
50963 BlindedTail_set_final_value_msat(&this_ptr_conv, val);
50966 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1new(JNIEnv *env, jclass clz, int64_tArray hops_arg, int8_tArray blinding_point_arg, int32_t excess_final_cltv_expiry_delta_arg, int64_t final_value_msat_arg) {
50967 LDKCVec_BlindedHopZ hops_arg_constr;
50968 hops_arg_constr.datalen = (*env)->GetArrayLength(env, hops_arg);
50969 if (hops_arg_constr.datalen > 0)
50970 hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKBlindedHop), "LDKCVec_BlindedHopZ Elements");
50972 hops_arg_constr.data = NULL;
50973 int64_t* hops_arg_vals = (*env)->GetLongArrayElements (env, hops_arg, NULL);
50974 for (size_t m = 0; m < hops_arg_constr.datalen; m++) {
50975 int64_t hops_arg_conv_12 = hops_arg_vals[m];
50976 LDKBlindedHop hops_arg_conv_12_conv;
50977 hops_arg_conv_12_conv.inner = untag_ptr(hops_arg_conv_12);
50978 hops_arg_conv_12_conv.is_owned = ptr_is_owned(hops_arg_conv_12);
50979 CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_12_conv);
50980 hops_arg_conv_12_conv = BlindedHop_clone(&hops_arg_conv_12_conv);
50981 hops_arg_constr.data[m] = hops_arg_conv_12_conv;
50983 (*env)->ReleaseLongArrayElements(env, hops_arg, hops_arg_vals, 0);
50984 LDKPublicKey blinding_point_arg_ref;
50985 CHECK((*env)->GetArrayLength(env, blinding_point_arg) == 33);
50986 (*env)->GetByteArrayRegion(env, blinding_point_arg, 0, 33, blinding_point_arg_ref.compressed_form);
50987 LDKBlindedTail ret_var = BlindedTail_new(hops_arg_constr, blinding_point_arg_ref, excess_final_cltv_expiry_delta_arg, final_value_msat_arg);
50988 int64_t ret_ref = 0;
50989 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50990 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
50994 static inline uint64_t BlindedTail_clone_ptr(LDKBlindedTail *NONNULL_PTR arg) {
50995 LDKBlindedTail ret_var = BlindedTail_clone(arg);
50996 int64_t ret_ref = 0;
50997 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
50998 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51001 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
51002 LDKBlindedTail arg_conv;
51003 arg_conv.inner = untag_ptr(arg);
51004 arg_conv.is_owned = ptr_is_owned(arg);
51005 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
51006 arg_conv.is_owned = false;
51007 int64_t ret_conv = BlindedTail_clone_ptr(&arg_conv);
51011 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1clone(JNIEnv *env, jclass clz, int64_t orig) {
51012 LDKBlindedTail orig_conv;
51013 orig_conv.inner = untag_ptr(orig);
51014 orig_conv.is_owned = ptr_is_owned(orig);
51015 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
51016 orig_conv.is_owned = false;
51017 LDKBlindedTail ret_var = BlindedTail_clone(&orig_conv);
51018 int64_t ret_ref = 0;
51019 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51020 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51024 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1hash(JNIEnv *env, jclass clz, int64_t o) {
51025 LDKBlindedTail o_conv;
51026 o_conv.inner = untag_ptr(o);
51027 o_conv.is_owned = ptr_is_owned(o);
51028 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
51029 o_conv.is_owned = false;
51030 int64_t ret_conv = BlindedTail_hash(&o_conv);
51034 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedTail_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
51035 LDKBlindedTail a_conv;
51036 a_conv.inner = untag_ptr(a);
51037 a_conv.is_owned = ptr_is_owned(a);
51038 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
51039 a_conv.is_owned = false;
51040 LDKBlindedTail b_conv;
51041 b_conv.inner = untag_ptr(b);
51042 b_conv.is_owned = ptr_is_owned(b);
51043 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
51044 b_conv.is_owned = false;
51045 jboolean ret_conv = BlindedTail_eq(&a_conv, &b_conv);
51049 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedTail_1write(JNIEnv *env, jclass clz, int64_t obj) {
51050 LDKBlindedTail obj_conv;
51051 obj_conv.inner = untag_ptr(obj);
51052 obj_conv.is_owned = ptr_is_owned(obj);
51053 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
51054 obj_conv.is_owned = false;
51055 LDKCVec_u8Z ret_var = BlindedTail_write(&obj_conv);
51056 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
51057 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
51058 CVec_u8Z_free(ret_var);
51062 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedTail_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
51063 LDKu8slice ser_ref;
51064 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
51065 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
51066 LDKCResult_BlindedTailDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedTailDecodeErrorZ), "LDKCResult_BlindedTailDecodeErrorZ");
51067 *ret_conv = BlindedTail_read(ser_ref);
51068 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
51069 return tag_ptr(ret_conv, true);
51072 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
51073 LDKPath this_obj_conv;
51074 this_obj_conv.inner = untag_ptr(this_obj);
51075 this_obj_conv.is_owned = ptr_is_owned(this_obj);
51076 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
51077 Path_free(this_obj_conv);
51080 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Path_1get_1hops(JNIEnv *env, jclass clz, int64_t this_ptr) {
51081 LDKPath this_ptr_conv;
51082 this_ptr_conv.inner = untag_ptr(this_ptr);
51083 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51084 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51085 this_ptr_conv.is_owned = false;
51086 LDKCVec_RouteHopZ ret_var = Path_get_hops(&this_ptr_conv);
51087 int64_tArray ret_arr = NULL;
51088 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
51089 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
51090 for (size_t k = 0; k < ret_var.datalen; k++) {
51091 LDKRouteHop ret_conv_10_var = ret_var.data[k];
51092 int64_t ret_conv_10_ref = 0;
51093 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var);
51094 ret_conv_10_ref = tag_ptr(ret_conv_10_var.inner, ret_conv_10_var.is_owned);
51095 ret_arr_ptr[k] = ret_conv_10_ref;
51097 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
51098 FREE(ret_var.data);
51102 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1set_1hops(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
51103 LDKPath this_ptr_conv;
51104 this_ptr_conv.inner = untag_ptr(this_ptr);
51105 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51106 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51107 this_ptr_conv.is_owned = false;
51108 LDKCVec_RouteHopZ val_constr;
51109 val_constr.datalen = (*env)->GetArrayLength(env, val);
51110 if (val_constr.datalen > 0)
51111 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
51113 val_constr.data = NULL;
51114 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
51115 for (size_t k = 0; k < val_constr.datalen; k++) {
51116 int64_t val_conv_10 = val_vals[k];
51117 LDKRouteHop val_conv_10_conv;
51118 val_conv_10_conv.inner = untag_ptr(val_conv_10);
51119 val_conv_10_conv.is_owned = ptr_is_owned(val_conv_10);
51120 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_10_conv);
51121 val_conv_10_conv = RouteHop_clone(&val_conv_10_conv);
51122 val_constr.data[k] = val_conv_10_conv;
51124 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
51125 Path_set_hops(&this_ptr_conv, val_constr);
51128 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1get_1blinded_1tail(JNIEnv *env, jclass clz, int64_t this_ptr) {
51129 LDKPath this_ptr_conv;
51130 this_ptr_conv.inner = untag_ptr(this_ptr);
51131 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51132 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51133 this_ptr_conv.is_owned = false;
51134 LDKBlindedTail ret_var = Path_get_blinded_tail(&this_ptr_conv);
51135 int64_t ret_ref = 0;
51136 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51137 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51141 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Path_1set_1blinded_1tail(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
51142 LDKPath this_ptr_conv;
51143 this_ptr_conv.inner = untag_ptr(this_ptr);
51144 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51145 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51146 this_ptr_conv.is_owned = false;
51147 LDKBlindedTail val_conv;
51148 val_conv.inner = untag_ptr(val);
51149 val_conv.is_owned = ptr_is_owned(val);
51150 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
51151 val_conv = BlindedTail_clone(&val_conv);
51152 Path_set_blinded_tail(&this_ptr_conv, val_conv);
51155 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1new(JNIEnv *env, jclass clz, int64_tArray hops_arg, int64_t blinded_tail_arg) {
51156 LDKCVec_RouteHopZ hops_arg_constr;
51157 hops_arg_constr.datalen = (*env)->GetArrayLength(env, hops_arg);
51158 if (hops_arg_constr.datalen > 0)
51159 hops_arg_constr.data = MALLOC(hops_arg_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
51161 hops_arg_constr.data = NULL;
51162 int64_t* hops_arg_vals = (*env)->GetLongArrayElements (env, hops_arg, NULL);
51163 for (size_t k = 0; k < hops_arg_constr.datalen; k++) {
51164 int64_t hops_arg_conv_10 = hops_arg_vals[k];
51165 LDKRouteHop hops_arg_conv_10_conv;
51166 hops_arg_conv_10_conv.inner = untag_ptr(hops_arg_conv_10);
51167 hops_arg_conv_10_conv.is_owned = ptr_is_owned(hops_arg_conv_10);
51168 CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_arg_conv_10_conv);
51169 hops_arg_conv_10_conv = RouteHop_clone(&hops_arg_conv_10_conv);
51170 hops_arg_constr.data[k] = hops_arg_conv_10_conv;
51172 (*env)->ReleaseLongArrayElements(env, hops_arg, hops_arg_vals, 0);
51173 LDKBlindedTail blinded_tail_arg_conv;
51174 blinded_tail_arg_conv.inner = untag_ptr(blinded_tail_arg);
51175 blinded_tail_arg_conv.is_owned = ptr_is_owned(blinded_tail_arg);
51176 CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_tail_arg_conv);
51177 blinded_tail_arg_conv = BlindedTail_clone(&blinded_tail_arg_conv);
51178 LDKPath ret_var = Path_new(hops_arg_constr, blinded_tail_arg_conv);
51179 int64_t ret_ref = 0;
51180 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51181 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51185 static inline uint64_t Path_clone_ptr(LDKPath *NONNULL_PTR arg) {
51186 LDKPath ret_var = Path_clone(arg);
51187 int64_t ret_ref = 0;
51188 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51189 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51192 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
51194 arg_conv.inner = untag_ptr(arg);
51195 arg_conv.is_owned = ptr_is_owned(arg);
51196 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
51197 arg_conv.is_owned = false;
51198 int64_t ret_conv = Path_clone_ptr(&arg_conv);
51202 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1clone(JNIEnv *env, jclass clz, int64_t orig) {
51204 orig_conv.inner = untag_ptr(orig);
51205 orig_conv.is_owned = ptr_is_owned(orig);
51206 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
51207 orig_conv.is_owned = false;
51208 LDKPath ret_var = Path_clone(&orig_conv);
51209 int64_t ret_ref = 0;
51210 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51211 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51215 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1hash(JNIEnv *env, jclass clz, int64_t o) {
51217 o_conv.inner = untag_ptr(o);
51218 o_conv.is_owned = ptr_is_owned(o);
51219 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
51220 o_conv.is_owned = false;
51221 int64_t ret_conv = Path_hash(&o_conv);
51225 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Path_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
51227 a_conv.inner = untag_ptr(a);
51228 a_conv.is_owned = ptr_is_owned(a);
51229 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
51230 a_conv.is_owned = false;
51232 b_conv.inner = untag_ptr(b);
51233 b_conv.is_owned = ptr_is_owned(b);
51234 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
51235 b_conv.is_owned = false;
51236 jboolean ret_conv = Path_eq(&a_conv, &b_conv);
51240 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1fee_1msat(JNIEnv *env, jclass clz, int64_t this_arg) {
51241 LDKPath this_arg_conv;
51242 this_arg_conv.inner = untag_ptr(this_arg);
51243 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51244 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51245 this_arg_conv.is_owned = false;
51246 int64_t ret_conv = Path_fee_msat(&this_arg_conv);
51250 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_arg) {
51251 LDKPath this_arg_conv;
51252 this_arg_conv.inner = untag_ptr(this_arg);
51253 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51254 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51255 this_arg_conv.is_owned = false;
51256 int64_t ret_conv = Path_final_value_msat(&this_arg_conv);
51260 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Path_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_arg) {
51261 LDKPath this_arg_conv;
51262 this_arg_conv.inner = untag_ptr(this_arg);
51263 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51264 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51265 this_arg_conv.is_owned = false;
51266 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
51267 *ret_copy = Path_final_cltv_expiry_delta(&this_arg_conv);
51268 int64_t ret_ref = tag_ptr(ret_copy, true);
51272 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
51273 LDKRoute this_obj_conv;
51274 this_obj_conv.inner = untag_ptr(this_obj);
51275 this_obj_conv.is_owned = ptr_is_owned(this_obj);
51276 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
51277 Route_free(this_obj_conv);
51280 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Route_1get_1paths(JNIEnv *env, jclass clz, int64_t this_ptr) {
51281 LDKRoute this_ptr_conv;
51282 this_ptr_conv.inner = untag_ptr(this_ptr);
51283 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51284 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51285 this_ptr_conv.is_owned = false;
51286 LDKCVec_PathZ ret_var = Route_get_paths(&this_ptr_conv);
51287 int64_tArray ret_arr = NULL;
51288 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
51289 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
51290 for (size_t g = 0; g < ret_var.datalen; g++) {
51291 LDKPath ret_conv_6_var = ret_var.data[g];
51292 int64_t ret_conv_6_ref = 0;
51293 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_6_var);
51294 ret_conv_6_ref = tag_ptr(ret_conv_6_var.inner, ret_conv_6_var.is_owned);
51295 ret_arr_ptr[g] = ret_conv_6_ref;
51297 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
51298 FREE(ret_var.data);
51302 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
51303 LDKRoute this_ptr_conv;
51304 this_ptr_conv.inner = untag_ptr(this_ptr);
51305 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51306 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51307 this_ptr_conv.is_owned = false;
51308 LDKCVec_PathZ val_constr;
51309 val_constr.datalen = (*env)->GetArrayLength(env, val);
51310 if (val_constr.datalen > 0)
51311 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements");
51313 val_constr.data = NULL;
51314 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
51315 for (size_t g = 0; g < val_constr.datalen; g++) {
51316 int64_t val_conv_6 = val_vals[g];
51317 LDKPath val_conv_6_conv;
51318 val_conv_6_conv.inner = untag_ptr(val_conv_6);
51319 val_conv_6_conv.is_owned = ptr_is_owned(val_conv_6);
51320 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_6_conv);
51321 val_conv_6_conv = Path_clone(&val_conv_6_conv);
51322 val_constr.data[g] = val_conv_6_conv;
51324 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
51325 Route_set_paths(&this_ptr_conv, val_constr);
51328 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr) {
51329 LDKRoute this_ptr_conv;
51330 this_ptr_conv.inner = untag_ptr(this_ptr);
51331 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51332 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51333 this_ptr_conv.is_owned = false;
51334 LDKPaymentParameters ret_var = Route_get_payment_params(&this_ptr_conv);
51335 int64_t ret_ref = 0;
51336 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51337 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51341 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
51342 LDKRoute this_ptr_conv;
51343 this_ptr_conv.inner = untag_ptr(this_ptr);
51344 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51345 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51346 this_ptr_conv.is_owned = false;
51347 LDKPaymentParameters val_conv;
51348 val_conv.inner = untag_ptr(val);
51349 val_conv.is_owned = ptr_is_owned(val);
51350 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
51351 val_conv = PaymentParameters_clone(&val_conv);
51352 Route_set_payment_params(&this_ptr_conv, val_conv);
51355 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv *env, jclass clz, int64_tArray paths_arg, int64_t payment_params_arg) {
51356 LDKCVec_PathZ paths_arg_constr;
51357 paths_arg_constr.datalen = (*env)->GetArrayLength(env, paths_arg);
51358 if (paths_arg_constr.datalen > 0)
51359 paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKPath), "LDKCVec_PathZ Elements");
51361 paths_arg_constr.data = NULL;
51362 int64_t* paths_arg_vals = (*env)->GetLongArrayElements (env, paths_arg, NULL);
51363 for (size_t g = 0; g < paths_arg_constr.datalen; g++) {
51364 int64_t paths_arg_conv_6 = paths_arg_vals[g];
51365 LDKPath paths_arg_conv_6_conv;
51366 paths_arg_conv_6_conv.inner = untag_ptr(paths_arg_conv_6);
51367 paths_arg_conv_6_conv.is_owned = ptr_is_owned(paths_arg_conv_6);
51368 CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_6_conv);
51369 paths_arg_conv_6_conv = Path_clone(&paths_arg_conv_6_conv);
51370 paths_arg_constr.data[g] = paths_arg_conv_6_conv;
51372 (*env)->ReleaseLongArrayElements(env, paths_arg, paths_arg_vals, 0);
51373 LDKPaymentParameters payment_params_arg_conv;
51374 payment_params_arg_conv.inner = untag_ptr(payment_params_arg);
51375 payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg);
51376 CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv);
51377 payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv);
51378 LDKRoute ret_var = Route_new(paths_arg_constr, payment_params_arg_conv);
51379 int64_t ret_ref = 0;
51380 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51381 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51385 static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) {
51386 LDKRoute ret_var = Route_clone(arg);
51387 int64_t ret_ref = 0;
51388 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51389 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51392 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
51394 arg_conv.inner = untag_ptr(arg);
51395 arg_conv.is_owned = ptr_is_owned(arg);
51396 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
51397 arg_conv.is_owned = false;
51398 int64_t ret_conv = Route_clone_ptr(&arg_conv);
51402 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1clone(JNIEnv *env, jclass clz, int64_t orig) {
51403 LDKRoute orig_conv;
51404 orig_conv.inner = untag_ptr(orig);
51405 orig_conv.is_owned = ptr_is_owned(orig);
51406 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
51407 orig_conv.is_owned = false;
51408 LDKRoute ret_var = Route_clone(&orig_conv);
51409 int64_t ret_ref = 0;
51410 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51411 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51415 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1hash(JNIEnv *env, jclass clz, int64_t o) {
51417 o_conv.inner = untag_ptr(o);
51418 o_conv.is_owned = ptr_is_owned(o);
51419 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
51420 o_conv.is_owned = false;
51421 int64_t ret_conv = Route_hash(&o_conv);
51425 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Route_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
51427 a_conv.inner = untag_ptr(a);
51428 a_conv.is_owned = ptr_is_owned(a);
51429 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
51430 a_conv.is_owned = false;
51432 b_conv.inner = untag_ptr(b);
51433 b_conv.is_owned = ptr_is_owned(b);
51434 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
51435 b_conv.is_owned = false;
51436 jboolean ret_conv = Route_eq(&a_conv, &b_conv);
51440 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1fees(JNIEnv *env, jclass clz, int64_t this_arg) {
51441 LDKRoute this_arg_conv;
51442 this_arg_conv.inner = untag_ptr(this_arg);
51443 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51444 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51445 this_arg_conv.is_owned = false;
51446 int64_t ret_conv = Route_get_total_fees(&this_arg_conv);
51450 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1get_1total_1amount(JNIEnv *env, jclass clz, int64_t this_arg) {
51451 LDKRoute this_arg_conv;
51452 this_arg_conv.inner = untag_ptr(this_arg);
51453 this_arg_conv.is_owned = ptr_is_owned(this_arg);
51454 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
51455 this_arg_conv.is_owned = false;
51456 int64_t ret_conv = Route_get_total_amount(&this_arg_conv);
51460 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv *env, jclass clz, int64_t obj) {
51462 obj_conv.inner = untag_ptr(obj);
51463 obj_conv.is_owned = ptr_is_owned(obj);
51464 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
51465 obj_conv.is_owned = false;
51466 LDKCVec_u8Z ret_var = Route_write(&obj_conv);
51467 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
51468 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
51469 CVec_u8Z_free(ret_var);
51473 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
51474 LDKu8slice ser_ref;
51475 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
51476 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
51477 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
51478 *ret_conv = Route_read(ser_ref);
51479 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
51480 return tag_ptr(ret_conv, true);
51483 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
51484 LDKRouteParameters this_obj_conv;
51485 this_obj_conv.inner = untag_ptr(this_obj);
51486 this_obj_conv.is_owned = ptr_is_owned(this_obj);
51487 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
51488 RouteParameters_free(this_obj_conv);
51491 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr) {
51492 LDKRouteParameters this_ptr_conv;
51493 this_ptr_conv.inner = untag_ptr(this_ptr);
51494 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51495 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51496 this_ptr_conv.is_owned = false;
51497 LDKPaymentParameters ret_var = RouteParameters_get_payment_params(&this_ptr_conv);
51498 int64_t ret_ref = 0;
51499 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51500 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51504 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1payment_1params(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
51505 LDKRouteParameters this_ptr_conv;
51506 this_ptr_conv.inner = untag_ptr(this_ptr);
51507 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51508 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51509 this_ptr_conv.is_owned = false;
51510 LDKPaymentParameters val_conv;
51511 val_conv.inner = untag_ptr(val);
51512 val_conv.is_owned = ptr_is_owned(val);
51513 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
51514 val_conv = PaymentParameters_clone(&val_conv);
51515 RouteParameters_set_payment_params(&this_ptr_conv, val_conv);
51518 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1get_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
51519 LDKRouteParameters this_ptr_conv;
51520 this_ptr_conv.inner = untag_ptr(this_ptr);
51521 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51522 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51523 this_ptr_conv.is_owned = false;
51524 int64_t ret_conv = RouteParameters_get_final_value_msat(&this_ptr_conv);
51528 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteParameters_1set_1final_1value_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
51529 LDKRouteParameters this_ptr_conv;
51530 this_ptr_conv.inner = untag_ptr(this_ptr);
51531 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51532 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51533 this_ptr_conv.is_owned = false;
51534 RouteParameters_set_final_value_msat(&this_ptr_conv, val);
51537 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) {
51538 LDKPaymentParameters payment_params_arg_conv;
51539 payment_params_arg_conv.inner = untag_ptr(payment_params_arg);
51540 payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg);
51541 CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv);
51542 payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv);
51543 LDKRouteParameters ret_var = RouteParameters_new(payment_params_arg_conv, final_value_msat_arg);
51544 int64_t ret_ref = 0;
51545 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51546 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51550 static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) {
51551 LDKRouteParameters ret_var = RouteParameters_clone(arg);
51552 int64_t ret_ref = 0;
51553 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51554 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51557 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
51558 LDKRouteParameters arg_conv;
51559 arg_conv.inner = untag_ptr(arg);
51560 arg_conv.is_owned = ptr_is_owned(arg);
51561 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
51562 arg_conv.is_owned = false;
51563 int64_t ret_conv = RouteParameters_clone_ptr(&arg_conv);
51567 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
51568 LDKRouteParameters orig_conv;
51569 orig_conv.inner = untag_ptr(orig);
51570 orig_conv.is_owned = ptr_is_owned(orig);
51571 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
51572 orig_conv.is_owned = false;
51573 LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv);
51574 int64_t ret_ref = 0;
51575 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51576 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51580 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
51581 LDKRouteParameters a_conv;
51582 a_conv.inner = untag_ptr(a);
51583 a_conv.is_owned = ptr_is_owned(a);
51584 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
51585 a_conv.is_owned = false;
51586 LDKRouteParameters b_conv;
51587 b_conv.inner = untag_ptr(b);
51588 b_conv.is_owned = ptr_is_owned(b);
51589 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
51590 b_conv.is_owned = false;
51591 jboolean ret_conv = RouteParameters_eq(&a_conv, &b_conv);
51595 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
51596 LDKRouteParameters obj_conv;
51597 obj_conv.inner = untag_ptr(obj);
51598 obj_conv.is_owned = ptr_is_owned(obj);
51599 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
51600 obj_conv.is_owned = false;
51601 LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv);
51602 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
51603 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
51604 CVec_u8Z_free(ret_var);
51608 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
51609 LDKu8slice ser_ref;
51610 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
51611 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
51612 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
51613 *ret_conv = RouteParameters_read(ser_ref);
51614 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
51615 return tag_ptr(ret_conv, true);
51618 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
51619 LDKPaymentParameters this_obj_conv;
51620 this_obj_conv.inner = untag_ptr(this_obj);
51621 this_obj_conv.is_owned = ptr_is_owned(this_obj);
51622 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
51623 PaymentParameters_free(this_obj_conv);
51626 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1payee_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr) {
51627 LDKPaymentParameters this_ptr_conv;
51628 this_ptr_conv.inner = untag_ptr(this_ptr);
51629 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51630 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51631 this_ptr_conv.is_owned = false;
51632 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
51633 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PaymentParameters_get_payee_pubkey(&this_ptr_conv).compressed_form);
51637 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1payee_1pubkey(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
51638 LDKPaymentParameters this_ptr_conv;
51639 this_ptr_conv.inner = untag_ptr(this_ptr);
51640 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51641 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51642 this_ptr_conv.is_owned = false;
51643 LDKPublicKey val_ref;
51644 CHECK((*env)->GetArrayLength(env, val) == 33);
51645 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
51646 PaymentParameters_set_payee_pubkey(&this_ptr_conv, val_ref);
51649 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1features(JNIEnv *env, jclass clz, int64_t this_ptr) {
51650 LDKPaymentParameters this_ptr_conv;
51651 this_ptr_conv.inner = untag_ptr(this_ptr);
51652 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51653 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51654 this_ptr_conv.is_owned = false;
51655 LDKInvoiceFeatures ret_var = PaymentParameters_get_features(&this_ptr_conv);
51656 int64_t ret_ref = 0;
51657 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51658 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51662 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1features(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
51663 LDKPaymentParameters this_ptr_conv;
51664 this_ptr_conv.inner = untag_ptr(this_ptr);
51665 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51666 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51667 this_ptr_conv.is_owned = false;
51668 LDKInvoiceFeatures val_conv;
51669 val_conv.inner = untag_ptr(val);
51670 val_conv.is_owned = ptr_is_owned(val);
51671 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
51672 val_conv = InvoiceFeatures_clone(&val_conv);
51673 PaymentParameters_set_features(&this_ptr_conv, val_conv);
51676 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1route_1hints(JNIEnv *env, jclass clz, int64_t this_ptr) {
51677 LDKPaymentParameters this_ptr_conv;
51678 this_ptr_conv.inner = untag_ptr(this_ptr);
51679 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51680 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51681 this_ptr_conv.is_owned = false;
51682 LDKHints *ret_copy = MALLOC(sizeof(LDKHints), "LDKHints");
51683 *ret_copy = PaymentParameters_get_route_hints(&this_ptr_conv);
51684 int64_t ret_ref = tag_ptr(ret_copy, true);
51688 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1route_1hints(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
51689 LDKPaymentParameters this_ptr_conv;
51690 this_ptr_conv.inner = untag_ptr(this_ptr);
51691 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51692 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51693 this_ptr_conv.is_owned = false;
51694 void* val_ptr = untag_ptr(val);
51695 CHECK_ACCESS(val_ptr);
51696 LDKHints val_conv = *(LDKHints*)(val_ptr);
51697 val_conv = Hints_clone((LDKHints*)untag_ptr(val));
51698 PaymentParameters_set_route_hints(&this_ptr_conv, val_conv);
51701 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr) {
51702 LDKPaymentParameters this_ptr_conv;
51703 this_ptr_conv.inner = untag_ptr(this_ptr);
51704 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51705 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51706 this_ptr_conv.is_owned = false;
51707 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
51708 *ret_copy = PaymentParameters_get_expiry_time(&this_ptr_conv);
51709 int64_t ret_ref = tag_ptr(ret_copy, true);
51713 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
51714 LDKPaymentParameters this_ptr_conv;
51715 this_ptr_conv.inner = untag_ptr(this_ptr);
51716 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51717 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51718 this_ptr_conv.is_owned = false;
51719 void* val_ptr = untag_ptr(val);
51720 CHECK_ACCESS(val_ptr);
51721 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
51722 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
51723 PaymentParameters_set_expiry_time(&this_ptr_conv, val_conv);
51726 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1total_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
51727 LDKPaymentParameters this_ptr_conv;
51728 this_ptr_conv.inner = untag_ptr(this_ptr);
51729 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51730 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51731 this_ptr_conv.is_owned = false;
51732 int32_t ret_conv = PaymentParameters_get_max_total_cltv_expiry_delta(&this_ptr_conv);
51736 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) {
51737 LDKPaymentParameters this_ptr_conv;
51738 this_ptr_conv.inner = untag_ptr(this_ptr);
51739 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51740 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51741 this_ptr_conv.is_owned = false;
51742 PaymentParameters_set_max_total_cltv_expiry_delta(&this_ptr_conv, val);
51745 JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1max_1path_1count(JNIEnv *env, jclass clz, int64_t this_ptr) {
51746 LDKPaymentParameters this_ptr_conv;
51747 this_ptr_conv.inner = untag_ptr(this_ptr);
51748 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51749 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51750 this_ptr_conv.is_owned = false;
51751 int8_t ret_conv = PaymentParameters_get_max_path_count(&this_ptr_conv);
51755 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1max_1path_1count(JNIEnv *env, jclass clz, int64_t this_ptr, int8_t val) {
51756 LDKPaymentParameters this_ptr_conv;
51757 this_ptr_conv.inner = untag_ptr(this_ptr);
51758 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51759 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51760 this_ptr_conv.is_owned = false;
51761 PaymentParameters_set_max_path_count(&this_ptr_conv, val);
51764 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) {
51765 LDKPaymentParameters this_ptr_conv;
51766 this_ptr_conv.inner = untag_ptr(this_ptr);
51767 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51768 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51769 this_ptr_conv.is_owned = false;
51770 int8_t ret_conv = PaymentParameters_get_max_channel_saturation_power_of_half(&this_ptr_conv);
51774 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) {
51775 LDKPaymentParameters this_ptr_conv;
51776 this_ptr_conv.inner = untag_ptr(this_ptr);
51777 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51778 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51779 this_ptr_conv.is_owned = false;
51780 PaymentParameters_set_max_channel_saturation_power_of_half(&this_ptr_conv, val);
51783 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1previously_1failed_1channels(JNIEnv *env, jclass clz, int64_t this_ptr) {
51784 LDKPaymentParameters this_ptr_conv;
51785 this_ptr_conv.inner = untag_ptr(this_ptr);
51786 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51787 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51788 this_ptr_conv.is_owned = false;
51789 LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_channels(&this_ptr_conv);
51790 int64_tArray ret_arr = NULL;
51791 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
51792 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
51793 for (size_t g = 0; g < ret_var.datalen; g++) {
51794 int64_t ret_conv_6_conv = ret_var.data[g];
51795 ret_arr_ptr[g] = ret_conv_6_conv;
51797 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
51798 FREE(ret_var.data);
51802 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1set_1previously_1failed_1channels(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
51803 LDKPaymentParameters this_ptr_conv;
51804 this_ptr_conv.inner = untag_ptr(this_ptr);
51805 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51806 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51807 this_ptr_conv.is_owned = false;
51808 LDKCVec_u64Z val_constr;
51809 val_constr.datalen = (*env)->GetArrayLength(env, val);
51810 if (val_constr.datalen > 0)
51811 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
51813 val_constr.data = NULL;
51814 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
51815 for (size_t g = 0; g < val_constr.datalen; g++) {
51816 int64_t val_conv_6 = val_vals[g];
51817 val_constr.data[g] = val_conv_6;
51819 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
51820 PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr);
51823 JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1get_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
51824 LDKPaymentParameters this_ptr_conv;
51825 this_ptr_conv.inner = untag_ptr(this_ptr);
51826 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51827 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51828 this_ptr_conv.is_owned = false;
51829 int32_t ret_conv = PaymentParameters_get_final_cltv_expiry_delta(&this_ptr_conv);
51833 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) {
51834 LDKPaymentParameters this_ptr_conv;
51835 this_ptr_conv.inner = untag_ptr(this_ptr);
51836 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
51837 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
51838 this_ptr_conv.is_owned = false;
51839 PaymentParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val);
51842 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_t 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) {
51843 LDKPublicKey payee_pubkey_arg_ref;
51844 CHECK((*env)->GetArrayLength(env, payee_pubkey_arg) == 33);
51845 (*env)->GetByteArrayRegion(env, payee_pubkey_arg, 0, 33, payee_pubkey_arg_ref.compressed_form);
51846 LDKInvoiceFeatures features_arg_conv;
51847 features_arg_conv.inner = untag_ptr(features_arg);
51848 features_arg_conv.is_owned = ptr_is_owned(features_arg);
51849 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
51850 features_arg_conv = InvoiceFeatures_clone(&features_arg_conv);
51851 void* route_hints_arg_ptr = untag_ptr(route_hints_arg);
51852 CHECK_ACCESS(route_hints_arg_ptr);
51853 LDKHints route_hints_arg_conv = *(LDKHints*)(route_hints_arg_ptr);
51854 route_hints_arg_conv = Hints_clone((LDKHints*)untag_ptr(route_hints_arg));
51855 void* expiry_time_arg_ptr = untag_ptr(expiry_time_arg);
51856 CHECK_ACCESS(expiry_time_arg_ptr);
51857 LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr);
51858 expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(expiry_time_arg));
51859 LDKCVec_u64Z previously_failed_channels_arg_constr;
51860 previously_failed_channels_arg_constr.datalen = (*env)->GetArrayLength(env, previously_failed_channels_arg);
51861 if (previously_failed_channels_arg_constr.datalen > 0)
51862 previously_failed_channels_arg_constr.data = MALLOC(previously_failed_channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
51864 previously_failed_channels_arg_constr.data = NULL;
51865 int64_t* previously_failed_channels_arg_vals = (*env)->GetLongArrayElements (env, previously_failed_channels_arg, NULL);
51866 for (size_t g = 0; g < previously_failed_channels_arg_constr.datalen; g++) {
51867 int64_t previously_failed_channels_arg_conv_6 = previously_failed_channels_arg_vals[g];
51868 previously_failed_channels_arg_constr.data[g] = previously_failed_channels_arg_conv_6;
51870 (*env)->ReleaseLongArrayElements(env, previously_failed_channels_arg, previously_failed_channels_arg_vals, 0);
51871 LDKPaymentParameters ret_var = PaymentParameters_new(payee_pubkey_arg_ref, features_arg_conv, route_hints_arg_conv, 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);
51872 int64_t ret_ref = 0;
51873 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51874 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51878 static inline uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg) {
51879 LDKPaymentParameters ret_var = PaymentParameters_clone(arg);
51880 int64_t ret_ref = 0;
51881 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51882 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51885 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
51886 LDKPaymentParameters arg_conv;
51887 arg_conv.inner = untag_ptr(arg);
51888 arg_conv.is_owned = ptr_is_owned(arg);
51889 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
51890 arg_conv.is_owned = false;
51891 int64_t ret_conv = PaymentParameters_clone_ptr(&arg_conv);
51895 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
51896 LDKPaymentParameters orig_conv;
51897 orig_conv.inner = untag_ptr(orig);
51898 orig_conv.is_owned = ptr_is_owned(orig);
51899 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
51900 orig_conv.is_owned = false;
51901 LDKPaymentParameters ret_var = PaymentParameters_clone(&orig_conv);
51902 int64_t ret_ref = 0;
51903 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51904 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51908 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1hash(JNIEnv *env, jclass clz, int64_t o) {
51909 LDKPaymentParameters o_conv;
51910 o_conv.inner = untag_ptr(o);
51911 o_conv.is_owned = ptr_is_owned(o);
51912 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
51913 o_conv.is_owned = false;
51914 int64_t ret_conv = PaymentParameters_hash(&o_conv);
51918 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
51919 LDKPaymentParameters a_conv;
51920 a_conv.inner = untag_ptr(a);
51921 a_conv.is_owned = ptr_is_owned(a);
51922 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
51923 a_conv.is_owned = false;
51924 LDKPaymentParameters b_conv;
51925 b_conv.inner = untag_ptr(b);
51926 b_conv.is_owned = ptr_is_owned(b);
51927 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
51928 b_conv.is_owned = false;
51929 jboolean ret_conv = PaymentParameters_eq(&a_conv, &b_conv);
51933 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1write(JNIEnv *env, jclass clz, int64_t obj) {
51934 LDKPaymentParameters obj_conv;
51935 obj_conv.inner = untag_ptr(obj);
51936 obj_conv.is_owned = ptr_is_owned(obj);
51937 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
51938 obj_conv.is_owned = false;
51939 LDKCVec_u8Z ret_var = PaymentParameters_write(&obj_conv);
51940 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
51941 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
51942 CVec_u8Z_free(ret_var);
51946 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentParameters_1read(JNIEnv *env, jclass clz, int8_tArray ser, int32_t arg) {
51947 LDKu8slice ser_ref;
51948 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
51949 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
51950 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
51951 *ret_conv = PaymentParameters_read(ser_ref, arg);
51952 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
51953 return tag_ptr(ret_conv, true);
51956 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) {
51957 LDKPublicKey payee_pubkey_ref;
51958 CHECK((*env)->GetArrayLength(env, payee_pubkey) == 33);
51959 (*env)->GetByteArrayRegion(env, payee_pubkey, 0, 33, payee_pubkey_ref.compressed_form);
51960 LDKPaymentParameters ret_var = PaymentParameters_from_node_id(payee_pubkey_ref, final_cltv_expiry_delta);
51961 int64_t ret_ref = 0;
51962 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51963 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51967 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) {
51968 LDKPublicKey payee_pubkey_ref;
51969 CHECK((*env)->GetArrayLength(env, payee_pubkey) == 33);
51970 (*env)->GetByteArrayRegion(env, payee_pubkey, 0, 33, payee_pubkey_ref.compressed_form);
51971 LDKPaymentParameters ret_var = PaymentParameters_for_keysend(payee_pubkey_ref, final_cltv_expiry_delta);
51972 int64_t ret_ref = 0;
51973 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
51974 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
51978 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Hints_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
51979 if (!ptr_is_owned(this_ptr)) return;
51980 void* this_ptr_ptr = untag_ptr(this_ptr);
51981 CHECK_ACCESS(this_ptr_ptr);
51982 LDKHints this_ptr_conv = *(LDKHints*)(this_ptr_ptr);
51983 FREE(untag_ptr(this_ptr));
51984 Hints_free(this_ptr_conv);
51987 static inline uint64_t Hints_clone_ptr(LDKHints *NONNULL_PTR arg) {
51988 LDKHints *ret_copy = MALLOC(sizeof(LDKHints), "LDKHints");
51989 *ret_copy = Hints_clone(arg);
51990 int64_t ret_ref = tag_ptr(ret_copy, true);
51993 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Hints_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
51994 LDKHints* arg_conv = (LDKHints*)untag_ptr(arg);
51995 int64_t ret_conv = Hints_clone_ptr(arg_conv);
51999 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Hints_1clone(JNIEnv *env, jclass clz, int64_t orig) {
52000 LDKHints* orig_conv = (LDKHints*)untag_ptr(orig);
52001 LDKHints *ret_copy = MALLOC(sizeof(LDKHints), "LDKHints");
52002 *ret_copy = Hints_clone(orig_conv);
52003 int64_t ret_ref = tag_ptr(ret_copy, true);
52007 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Hints_1blinded(JNIEnv *env, jclass clz, int64_tArray a) {
52008 LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ a_constr;
52009 a_constr.datalen = (*env)->GetArrayLength(env, a);
52010 if (a_constr.datalen > 0)
52011 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements");
52013 a_constr.data = NULL;
52014 int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
52015 for (size_t l = 0; l < a_constr.datalen; l++) {
52016 int64_t a_conv_37 = a_vals[l];
52017 void* a_conv_37_ptr = untag_ptr(a_conv_37);
52018 CHECK_ACCESS(a_conv_37_ptr);
52019 LDKC2Tuple_BlindedPayInfoBlindedPathZ a_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(a_conv_37_ptr);
52020 a_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(a_conv_37));
52021 a_constr.data[l] = a_conv_37_conv;
52023 (*env)->ReleaseLongArrayElements(env, a, a_vals, 0);
52024 LDKHints *ret_copy = MALLOC(sizeof(LDKHints), "LDKHints");
52025 *ret_copy = Hints_blinded(a_constr);
52026 int64_t ret_ref = tag_ptr(ret_copy, true);
52030 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Hints_1clear(JNIEnv *env, jclass clz, int64_tArray a) {
52031 LDKCVec_RouteHintZ a_constr;
52032 a_constr.datalen = (*env)->GetArrayLength(env, a);
52033 if (a_constr.datalen > 0)
52034 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
52036 a_constr.data = NULL;
52037 int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
52038 for (size_t l = 0; l < a_constr.datalen; l++) {
52039 int64_t a_conv_11 = a_vals[l];
52040 LDKRouteHint a_conv_11_conv;
52041 a_conv_11_conv.inner = untag_ptr(a_conv_11);
52042 a_conv_11_conv.is_owned = ptr_is_owned(a_conv_11);
52043 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv_11_conv);
52044 a_conv_11_conv = RouteHint_clone(&a_conv_11_conv);
52045 a_constr.data[l] = a_conv_11_conv;
52047 (*env)->ReleaseLongArrayElements(env, a, a_vals, 0);
52048 LDKHints *ret_copy = MALLOC(sizeof(LDKHints), "LDKHints");
52049 *ret_copy = Hints_clear(a_constr);
52050 int64_t ret_ref = tag_ptr(ret_copy, true);
52054 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Hints_1hash(JNIEnv *env, jclass clz, int64_t o) {
52055 LDKHints* o_conv = (LDKHints*)untag_ptr(o);
52056 int64_t ret_conv = Hints_hash(o_conv);
52060 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Hints_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
52061 LDKHints* a_conv = (LDKHints*)untag_ptr(a);
52062 LDKHints* b_conv = (LDKHints*)untag_ptr(b);
52063 jboolean ret_conv = Hints_eq(a_conv, b_conv);
52067 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
52068 LDKRouteHint this_obj_conv;
52069 this_obj_conv.inner = untag_ptr(this_obj);
52070 this_obj_conv.is_owned = ptr_is_owned(this_obj);
52071 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
52072 RouteHint_free(this_obj_conv);
52075 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
52076 LDKRouteHint this_ptr_conv;
52077 this_ptr_conv.inner = untag_ptr(this_ptr);
52078 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52079 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52080 this_ptr_conv.is_owned = false;
52081 LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv);
52082 int64_tArray ret_arr = NULL;
52083 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
52084 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
52085 for (size_t o = 0; o < ret_var.datalen; o++) {
52086 LDKRouteHintHop ret_conv_14_var = ret_var.data[o];
52087 int64_t ret_conv_14_ref = 0;
52088 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
52089 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
52090 ret_arr_ptr[o] = ret_conv_14_ref;
52092 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
52093 FREE(ret_var.data);
52097 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_tArray val) {
52098 LDKRouteHint this_ptr_conv;
52099 this_ptr_conv.inner = untag_ptr(this_ptr);
52100 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52101 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52102 this_ptr_conv.is_owned = false;
52103 LDKCVec_RouteHintHopZ val_constr;
52104 val_constr.datalen = (*env)->GetArrayLength(env, val);
52105 if (val_constr.datalen > 0)
52106 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
52108 val_constr.data = NULL;
52109 int64_t* val_vals = (*env)->GetLongArrayElements (env, val, NULL);
52110 for (size_t o = 0; o < val_constr.datalen; o++) {
52111 int64_t val_conv_14 = val_vals[o];
52112 LDKRouteHintHop val_conv_14_conv;
52113 val_conv_14_conv.inner = untag_ptr(val_conv_14);
52114 val_conv_14_conv.is_owned = ptr_is_owned(val_conv_14);
52115 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv);
52116 val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv);
52117 val_constr.data[o] = val_conv_14_conv;
52119 (*env)->ReleaseLongArrayElements(env, val, val_vals, 0);
52120 RouteHint_set_a(&this_ptr_conv, val_constr);
52123 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, jclass clz, int64_tArray a_arg) {
52124 LDKCVec_RouteHintHopZ a_arg_constr;
52125 a_arg_constr.datalen = (*env)->GetArrayLength(env, a_arg);
52126 if (a_arg_constr.datalen > 0)
52127 a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
52129 a_arg_constr.data = NULL;
52130 int64_t* a_arg_vals = (*env)->GetLongArrayElements (env, a_arg, NULL);
52131 for (size_t o = 0; o < a_arg_constr.datalen; o++) {
52132 int64_t a_arg_conv_14 = a_arg_vals[o];
52133 LDKRouteHintHop a_arg_conv_14_conv;
52134 a_arg_conv_14_conv.inner = untag_ptr(a_arg_conv_14);
52135 a_arg_conv_14_conv.is_owned = ptr_is_owned(a_arg_conv_14);
52136 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv);
52137 a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv);
52138 a_arg_constr.data[o] = a_arg_conv_14_conv;
52140 (*env)->ReleaseLongArrayElements(env, a_arg, a_arg_vals, 0);
52141 LDKRouteHint ret_var = RouteHint_new(a_arg_constr);
52142 int64_t ret_ref = 0;
52143 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52144 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52148 static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) {
52149 LDKRouteHint ret_var = RouteHint_clone(arg);
52150 int64_t ret_ref = 0;
52151 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52152 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52155 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
52156 LDKRouteHint arg_conv;
52157 arg_conv.inner = untag_ptr(arg);
52158 arg_conv.is_owned = ptr_is_owned(arg);
52159 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
52160 arg_conv.is_owned = false;
52161 int64_t ret_conv = RouteHint_clone_ptr(&arg_conv);
52165 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1clone(JNIEnv *env, jclass clz, int64_t orig) {
52166 LDKRouteHint orig_conv;
52167 orig_conv.inner = untag_ptr(orig);
52168 orig_conv.is_owned = ptr_is_owned(orig);
52169 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
52170 orig_conv.is_owned = false;
52171 LDKRouteHint ret_var = RouteHint_clone(&orig_conv);
52172 int64_t ret_ref = 0;
52173 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52174 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52178 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1hash(JNIEnv *env, jclass clz, int64_t o) {
52179 LDKRouteHint o_conv;
52180 o_conv.inner = untag_ptr(o);
52181 o_conv.is_owned = ptr_is_owned(o);
52182 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
52183 o_conv.is_owned = false;
52184 int64_t ret_conv = RouteHint_hash(&o_conv);
52188 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHint_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
52189 LDKRouteHint a_conv;
52190 a_conv.inner = untag_ptr(a);
52191 a_conv.is_owned = ptr_is_owned(a);
52192 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
52193 a_conv.is_owned = false;
52194 LDKRouteHint b_conv;
52195 b_conv.inner = untag_ptr(b);
52196 b_conv.is_owned = ptr_is_owned(b);
52197 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
52198 b_conv.is_owned = false;
52199 jboolean ret_conv = RouteHint_eq(&a_conv, &b_conv);
52203 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHint_1write(JNIEnv *env, jclass clz, int64_t obj) {
52204 LDKRouteHint obj_conv;
52205 obj_conv.inner = untag_ptr(obj);
52206 obj_conv.is_owned = ptr_is_owned(obj);
52207 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
52208 obj_conv.is_owned = false;
52209 LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv);
52210 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
52211 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
52212 CVec_u8Z_free(ret_var);
52216 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
52217 LDKu8slice ser_ref;
52218 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
52219 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
52220 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
52221 *ret_conv = RouteHint_read(ser_ref);
52222 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
52223 return tag_ptr(ret_conv, true);
52226 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
52227 LDKRouteHintHop this_obj_conv;
52228 this_obj_conv.inner = untag_ptr(this_obj);
52229 this_obj_conv.is_owned = ptr_is_owned(this_obj);
52230 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
52231 RouteHintHop_free(this_obj_conv);
52234 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1src_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
52235 LDKRouteHintHop this_ptr_conv;
52236 this_ptr_conv.inner = untag_ptr(this_ptr);
52237 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52238 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52239 this_ptr_conv.is_owned = false;
52240 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
52241 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form);
52245 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1src_1node_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
52246 LDKRouteHintHop this_ptr_conv;
52247 this_ptr_conv.inner = untag_ptr(this_ptr);
52248 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52249 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52250 this_ptr_conv.is_owned = false;
52251 LDKPublicKey val_ref;
52252 CHECK((*env)->GetArrayLength(env, val) == 33);
52253 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
52254 RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref);
52257 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr) {
52258 LDKRouteHintHop this_ptr_conv;
52259 this_ptr_conv.inner = untag_ptr(this_ptr);
52260 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52261 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52262 this_ptr_conv.is_owned = false;
52263 int64_t ret_conv = RouteHintHop_get_short_channel_id(&this_ptr_conv);
52267 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1short_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
52268 LDKRouteHintHop this_ptr_conv;
52269 this_ptr_conv.inner = untag_ptr(this_ptr);
52270 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52271 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52272 this_ptr_conv.is_owned = false;
52273 RouteHintHop_set_short_channel_id(&this_ptr_conv, val);
52276 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1fees(JNIEnv *env, jclass clz, int64_t this_ptr) {
52277 LDKRouteHintHop this_ptr_conv;
52278 this_ptr_conv.inner = untag_ptr(this_ptr);
52279 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52280 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52281 this_ptr_conv.is_owned = false;
52282 LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv);
52283 int64_t ret_ref = 0;
52284 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52285 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52289 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1fees(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
52290 LDKRouteHintHop this_ptr_conv;
52291 this_ptr_conv.inner = untag_ptr(this_ptr);
52292 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52293 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52294 this_ptr_conv.is_owned = false;
52295 LDKRoutingFees val_conv;
52296 val_conv.inner = untag_ptr(val);
52297 val_conv.is_owned = ptr_is_owned(val);
52298 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
52299 val_conv = RoutingFees_clone(&val_conv);
52300 RouteHintHop_set_fees(&this_ptr_conv, val_conv);
52303 JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) {
52304 LDKRouteHintHop this_ptr_conv;
52305 this_ptr_conv.inner = untag_ptr(this_ptr);
52306 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52307 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52308 this_ptr_conv.is_owned = false;
52309 int16_t ret_conv = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv);
52313 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) {
52314 LDKRouteHintHop this_ptr_conv;
52315 this_ptr_conv.inner = untag_ptr(this_ptr);
52316 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52317 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52318 this_ptr_conv.is_owned = false;
52319 RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val);
52322 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
52323 LDKRouteHintHop this_ptr_conv;
52324 this_ptr_conv.inner = untag_ptr(this_ptr);
52325 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52326 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52327 this_ptr_conv.is_owned = false;
52328 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
52329 *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv);
52330 int64_t ret_ref = tag_ptr(ret_copy, true);
52334 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1minimum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
52335 LDKRouteHintHop this_ptr_conv;
52336 this_ptr_conv.inner = untag_ptr(this_ptr);
52337 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52338 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52339 this_ptr_conv.is_owned = false;
52340 void* val_ptr = untag_ptr(val);
52341 CHECK_ACCESS(val_ptr);
52342 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
52343 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
52344 RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv);
52347 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1get_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
52348 LDKRouteHintHop this_ptr_conv;
52349 this_ptr_conv.inner = untag_ptr(this_ptr);
52350 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52351 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52352 this_ptr_conv.is_owned = false;
52353 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
52354 *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv);
52355 int64_t ret_ref = tag_ptr(ret_copy, true);
52359 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1set_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
52360 LDKRouteHintHop this_ptr_conv;
52361 this_ptr_conv.inner = untag_ptr(this_ptr);
52362 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52363 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52364 this_ptr_conv.is_owned = false;
52365 void* val_ptr = untag_ptr(val);
52366 CHECK_ACCESS(val_ptr);
52367 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
52368 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
52369 RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv);
52372 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) {
52373 LDKPublicKey src_node_id_arg_ref;
52374 CHECK((*env)->GetArrayLength(env, src_node_id_arg) == 33);
52375 (*env)->GetByteArrayRegion(env, src_node_id_arg, 0, 33, src_node_id_arg_ref.compressed_form);
52376 LDKRoutingFees fees_arg_conv;
52377 fees_arg_conv.inner = untag_ptr(fees_arg);
52378 fees_arg_conv.is_owned = ptr_is_owned(fees_arg);
52379 CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
52380 fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
52381 void* htlc_minimum_msat_arg_ptr = untag_ptr(htlc_minimum_msat_arg);
52382 CHECK_ACCESS(htlc_minimum_msat_arg_ptr);
52383 LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr);
52384 htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_minimum_msat_arg));
52385 void* htlc_maximum_msat_arg_ptr = untag_ptr(htlc_maximum_msat_arg);
52386 CHECK_ACCESS(htlc_maximum_msat_arg_ptr);
52387 LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
52388 htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat_arg));
52389 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);
52390 int64_t ret_ref = 0;
52391 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52392 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52396 static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) {
52397 LDKRouteHintHop ret_var = RouteHintHop_clone(arg);
52398 int64_t ret_ref = 0;
52399 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52400 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52403 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
52404 LDKRouteHintHop arg_conv;
52405 arg_conv.inner = untag_ptr(arg);
52406 arg_conv.is_owned = ptr_is_owned(arg);
52407 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
52408 arg_conv.is_owned = false;
52409 int64_t ret_conv = RouteHintHop_clone_ptr(&arg_conv);
52413 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone(JNIEnv *env, jclass clz, int64_t orig) {
52414 LDKRouteHintHop orig_conv;
52415 orig_conv.inner = untag_ptr(orig);
52416 orig_conv.is_owned = ptr_is_owned(orig);
52417 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
52418 orig_conv.is_owned = false;
52419 LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv);
52420 int64_t ret_ref = 0;
52421 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52422 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52426 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1hash(JNIEnv *env, jclass clz, int64_t o) {
52427 LDKRouteHintHop o_conv;
52428 o_conv.inner = untag_ptr(o);
52429 o_conv.is_owned = ptr_is_owned(o);
52430 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
52431 o_conv.is_owned = false;
52432 int64_t ret_conv = RouteHintHop_hash(&o_conv);
52436 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
52437 LDKRouteHintHop a_conv;
52438 a_conv.inner = untag_ptr(a);
52439 a_conv.is_owned = ptr_is_owned(a);
52440 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
52441 a_conv.is_owned = false;
52442 LDKRouteHintHop b_conv;
52443 b_conv.inner = untag_ptr(b);
52444 b_conv.is_owned = ptr_is_owned(b);
52445 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
52446 b_conv.is_owned = false;
52447 jboolean ret_conv = RouteHintHop_eq(&a_conv, &b_conv);
52451 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1write(JNIEnv *env, jclass clz, int64_t obj) {
52452 LDKRouteHintHop obj_conv;
52453 obj_conv.inner = untag_ptr(obj);
52454 obj_conv.is_owned = ptr_is_owned(obj);
52455 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
52456 obj_conv.is_owned = false;
52457 LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv);
52458 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
52459 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
52460 CVec_u8Z_free(ret_var);
52464 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
52465 LDKu8slice ser_ref;
52466 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
52467 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
52468 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
52469 *ret_conv = RouteHintHop_read(ser_ref);
52470 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
52471 return tag_ptr(ret_conv, true);
52474 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) {
52475 LDKPublicKey our_node_pubkey_ref;
52476 CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33);
52477 (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form);
52478 LDKRouteParameters route_params_conv;
52479 route_params_conv.inner = untag_ptr(route_params);
52480 route_params_conv.is_owned = ptr_is_owned(route_params);
52481 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
52482 route_params_conv.is_owned = false;
52483 LDKNetworkGraph network_graph_conv;
52484 network_graph_conv.inner = untag_ptr(network_graph);
52485 network_graph_conv.is_owned = ptr_is_owned(network_graph);
52486 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
52487 network_graph_conv.is_owned = false;
52488 LDKCVec_ChannelDetailsZ first_hops_constr;
52489 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
52490 if (first_hops != NULL) {
52491 first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops);
52492 if (first_hops_constr.datalen > 0)
52493 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
52495 first_hops_constr.data = NULL;
52496 int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL);
52497 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
52498 int64_t first_hops_conv_16 = first_hops_vals[q];
52499 LDKChannelDetails first_hops_conv_16_conv;
52500 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
52501 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
52502 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
52503 first_hops_conv_16_conv.is_owned = false;
52504 first_hops_constr.data[q] = first_hops_conv_16_conv;
52506 (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
52507 first_hops_ptr = &first_hops_constr;
52509 void* logger_ptr = untag_ptr(logger);
52510 CHECK_ACCESS(logger_ptr);
52511 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
52512 if (logger_conv.free == LDKLogger_JCalls_free) {
52513 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
52514 LDKLogger_JCalls_cloned(&logger_conv);
52516 void* scorer_ptr = untag_ptr(scorer);
52517 if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
52518 LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
52519 uint8_t random_seed_bytes_arr[32];
52520 CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32);
52521 (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr);
52522 uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
52523 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
52524 *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);
52525 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
52526 return tag_ptr(ret_conv, true);
52529 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) {
52530 LDKPublicKey our_node_pubkey_ref;
52531 CHECK((*env)->GetArrayLength(env, our_node_pubkey) == 33);
52532 (*env)->GetByteArrayRegion(env, our_node_pubkey, 0, 33, our_node_pubkey_ref.compressed_form);
52533 LDKCVec_PublicKeyZ hops_constr;
52534 hops_constr.datalen = (*env)->GetArrayLength(env, hops);
52535 if (hops_constr.datalen > 0)
52536 hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
52538 hops_constr.data = NULL;
52539 for (size_t i = 0; i < hops_constr.datalen; i++) {
52540 int8_tArray hops_conv_8 = (*env)->GetObjectArrayElement(env, hops, i);
52541 LDKPublicKey hops_conv_8_ref;
52542 CHECK((*env)->GetArrayLength(env, hops_conv_8) == 33);
52543 (*env)->GetByteArrayRegion(env, hops_conv_8, 0, 33, hops_conv_8_ref.compressed_form);
52544 hops_constr.data[i] = hops_conv_8_ref;
52546 LDKRouteParameters route_params_conv;
52547 route_params_conv.inner = untag_ptr(route_params);
52548 route_params_conv.is_owned = ptr_is_owned(route_params);
52549 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
52550 route_params_conv.is_owned = false;
52551 LDKNetworkGraph network_graph_conv;
52552 network_graph_conv.inner = untag_ptr(network_graph);
52553 network_graph_conv.is_owned = ptr_is_owned(network_graph);
52554 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
52555 network_graph_conv.is_owned = false;
52556 void* logger_ptr = untag_ptr(logger);
52557 CHECK_ACCESS(logger_ptr);
52558 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
52559 if (logger_conv.free == LDKLogger_JCalls_free) {
52560 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
52561 LDKLogger_JCalls_cloned(&logger_conv);
52563 uint8_t random_seed_bytes_arr[32];
52564 CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32);
52565 (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_arr);
52566 uint8_t (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
52567 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
52568 *ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref);
52569 return tag_ptr(ret_conv, true);
52572 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Score_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
52573 if (!ptr_is_owned(this_ptr)) return;
52574 void* this_ptr_ptr = untag_ptr(this_ptr);
52575 CHECK_ACCESS(this_ptr_ptr);
52576 LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
52577 FREE(untag_ptr(this_ptr));
52578 Score_free(this_ptr_conv);
52581 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockableScore_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
52582 if (!ptr_is_owned(this_ptr)) return;
52583 void* this_ptr_ptr = untag_ptr(this_ptr);
52584 CHECK_ACCESS(this_ptr_ptr);
52585 LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr);
52586 FREE(untag_ptr(this_ptr));
52587 LockableScore_free(this_ptr_conv);
52590 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WriteableScore_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
52591 if (!ptr_is_owned(this_ptr)) return;
52592 void* this_ptr_ptr = untag_ptr(this_ptr);
52593 CHECK_ACCESS(this_ptr_ptr);
52594 LDKWriteableScore this_ptr_conv = *(LDKWriteableScore*)(this_ptr_ptr);
52595 FREE(untag_ptr(this_ptr));
52596 WriteableScore_free(this_ptr_conv);
52599 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
52600 LDKMultiThreadedLockableScore this_obj_conv;
52601 this_obj_conv.inner = untag_ptr(this_obj);
52602 this_obj_conv.is_owned = ptr_is_owned(this_obj);
52603 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
52604 MultiThreadedLockableScore_free(this_obj_conv);
52607 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLock_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
52608 LDKMultiThreadedScoreLock this_obj_conv;
52609 this_obj_conv.inner = untag_ptr(this_obj);
52610 this_obj_conv.is_owned = ptr_is_owned(this_obj);
52611 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
52612 MultiThreadedScoreLock_free(this_obj_conv);
52615 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLock_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) {
52616 LDKMultiThreadedScoreLock this_arg_conv;
52617 this_arg_conv.inner = untag_ptr(this_arg);
52618 this_arg_conv.is_owned = ptr_is_owned(this_arg);
52619 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
52620 this_arg_conv.is_owned = false;
52621 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
52622 *ret_ret = MultiThreadedScoreLock_as_Score(&this_arg_conv);
52623 return tag_ptr(ret_ret, true);
52626 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedScoreLock_1write(JNIEnv *env, jclass clz, int64_t obj) {
52627 LDKMultiThreadedScoreLock obj_conv;
52628 obj_conv.inner = untag_ptr(obj);
52629 obj_conv.is_owned = ptr_is_owned(obj);
52630 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
52631 obj_conv.is_owned = false;
52632 LDKCVec_u8Z ret_var = MultiThreadedScoreLock_write(&obj_conv);
52633 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
52634 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
52635 CVec_u8Z_free(ret_var);
52639 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1as_1LockableScore(JNIEnv *env, jclass clz, int64_t this_arg) {
52640 LDKMultiThreadedLockableScore this_arg_conv;
52641 this_arg_conv.inner = untag_ptr(this_arg);
52642 this_arg_conv.is_owned = ptr_is_owned(this_arg);
52643 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
52644 this_arg_conv.is_owned = false;
52645 LDKLockableScore* ret_ret = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
52646 *ret_ret = MultiThreadedLockableScore_as_LockableScore(&this_arg_conv);
52647 return tag_ptr(ret_ret, true);
52650 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1write(JNIEnv *env, jclass clz, int64_t obj) {
52651 LDKMultiThreadedLockableScore obj_conv;
52652 obj_conv.inner = untag_ptr(obj);
52653 obj_conv.is_owned = ptr_is_owned(obj);
52654 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
52655 obj_conv.is_owned = false;
52656 LDKCVec_u8Z ret_var = MultiThreadedLockableScore_write(&obj_conv);
52657 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
52658 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
52659 CVec_u8Z_free(ret_var);
52663 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1as_1WriteableScore(JNIEnv *env, jclass clz, int64_t this_arg) {
52664 LDKMultiThreadedLockableScore this_arg_conv;
52665 this_arg_conv.inner = untag_ptr(this_arg);
52666 this_arg_conv.is_owned = ptr_is_owned(this_arg);
52667 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
52668 this_arg_conv.is_owned = false;
52669 LDKWriteableScore* ret_ret = MALLOC(sizeof(LDKWriteableScore), "LDKWriteableScore");
52670 *ret_ret = MultiThreadedLockableScore_as_WriteableScore(&this_arg_conv);
52671 return tag_ptr(ret_ret, true);
52674 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MultiThreadedLockableScore_1new(JNIEnv *env, jclass clz, int64_t score) {
52675 void* score_ptr = untag_ptr(score);
52676 CHECK_ACCESS(score_ptr);
52677 LDKScore score_conv = *(LDKScore*)(score_ptr);
52678 if (score_conv.free == LDKScore_JCalls_free) {
52679 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
52680 LDKScore_JCalls_cloned(&score_conv);
52682 LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv);
52683 int64_t ret_ref = 0;
52684 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52685 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52689 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
52690 LDKChannelUsage this_obj_conv;
52691 this_obj_conv.inner = untag_ptr(this_obj);
52692 this_obj_conv.is_owned = ptr_is_owned(this_obj);
52693 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
52694 ChannelUsage_free(this_obj_conv);
52697 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
52698 LDKChannelUsage this_ptr_conv;
52699 this_ptr_conv.inner = untag_ptr(this_ptr);
52700 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52701 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52702 this_ptr_conv.is_owned = false;
52703 int64_t ret_conv = ChannelUsage_get_amount_msat(&this_ptr_conv);
52707 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1amount_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
52708 LDKChannelUsage this_ptr_conv;
52709 this_ptr_conv.inner = untag_ptr(this_ptr);
52710 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52711 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52712 this_ptr_conv.is_owned = false;
52713 ChannelUsage_set_amount_msat(&this_ptr_conv, val);
52716 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
52717 LDKChannelUsage this_ptr_conv;
52718 this_ptr_conv.inner = untag_ptr(this_ptr);
52719 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52720 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52721 this_ptr_conv.is_owned = false;
52722 int64_t ret_conv = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv);
52726 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1inflight_1htlc_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
52727 LDKChannelUsage this_ptr_conv;
52728 this_ptr_conv.inner = untag_ptr(this_ptr);
52729 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52730 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52731 this_ptr_conv.is_owned = false;
52732 ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val);
52735 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1get_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr) {
52736 LDKChannelUsage this_ptr_conv;
52737 this_ptr_conv.inner = untag_ptr(this_ptr);
52738 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52739 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52740 this_ptr_conv.is_owned = false;
52741 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
52742 *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv);
52743 int64_t ret_ref = tag_ptr(ret_copy, true);
52747 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1set_1effective_1capacity(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
52748 LDKChannelUsage this_ptr_conv;
52749 this_ptr_conv.inner = untag_ptr(this_ptr);
52750 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52751 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52752 this_ptr_conv.is_owned = false;
52753 void* val_ptr = untag_ptr(val);
52754 CHECK_ACCESS(val_ptr);
52755 LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr);
52756 val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(val));
52757 ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv);
52760 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) {
52761 void* effective_capacity_arg_ptr = untag_ptr(effective_capacity_arg);
52762 CHECK_ACCESS(effective_capacity_arg_ptr);
52763 LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr);
52764 effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(effective_capacity_arg));
52765 LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg_conv);
52766 int64_t ret_ref = 0;
52767 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52768 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52772 static inline uint64_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) {
52773 LDKChannelUsage ret_var = ChannelUsage_clone(arg);
52774 int64_t ret_ref = 0;
52775 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52776 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52779 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
52780 LDKChannelUsage arg_conv;
52781 arg_conv.inner = untag_ptr(arg);
52782 arg_conv.is_owned = ptr_is_owned(arg);
52783 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
52784 arg_conv.is_owned = false;
52785 int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv);
52789 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelUsage_1clone(JNIEnv *env, jclass clz, int64_t orig) {
52790 LDKChannelUsage orig_conv;
52791 orig_conv.inner = untag_ptr(orig);
52792 orig_conv.is_owned = ptr_is_owned(orig);
52793 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
52794 orig_conv.is_owned = false;
52795 LDKChannelUsage ret_var = ChannelUsage_clone(&orig_conv);
52796 int64_t ret_ref = 0;
52797 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52798 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52802 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
52803 LDKFixedPenaltyScorer this_obj_conv;
52804 this_obj_conv.inner = untag_ptr(this_obj);
52805 this_obj_conv.is_owned = ptr_is_owned(this_obj);
52806 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
52807 FixedPenaltyScorer_free(this_obj_conv);
52810 static inline uint64_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) {
52811 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(arg);
52812 int64_t ret_ref = 0;
52813 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52814 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52817 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
52818 LDKFixedPenaltyScorer arg_conv;
52819 arg_conv.inner = untag_ptr(arg);
52820 arg_conv.is_owned = ptr_is_owned(arg);
52821 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
52822 arg_conv.is_owned = false;
52823 int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv);
52827 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1clone(JNIEnv *env, jclass clz, int64_t orig) {
52828 LDKFixedPenaltyScorer orig_conv;
52829 orig_conv.inner = untag_ptr(orig);
52830 orig_conv.is_owned = ptr_is_owned(orig);
52831 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
52832 orig_conv.is_owned = false;
52833 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv);
52834 int64_t ret_ref = 0;
52835 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52836 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52840 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1with_1penalty(JNIEnv *env, jclass clz, int64_t penalty_msat) {
52841 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat);
52842 int64_t ret_ref = 0;
52843 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
52844 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
52848 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) {
52849 LDKFixedPenaltyScorer this_arg_conv;
52850 this_arg_conv.inner = untag_ptr(this_arg);
52851 this_arg_conv.is_owned = ptr_is_owned(this_arg);
52852 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
52853 this_arg_conv.is_owned = false;
52854 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
52855 *ret_ret = FixedPenaltyScorer_as_Score(&this_arg_conv);
52856 return tag_ptr(ret_ret, true);
52859 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1write(JNIEnv *env, jclass clz, int64_t obj) {
52860 LDKFixedPenaltyScorer obj_conv;
52861 obj_conv.inner = untag_ptr(obj);
52862 obj_conv.is_owned = ptr_is_owned(obj);
52863 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
52864 obj_conv.is_owned = false;
52865 LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv);
52866 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
52867 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
52868 CVec_u8Z_free(ret_var);
52872 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FixedPenaltyScorer_1read(JNIEnv *env, jclass clz, int8_tArray ser, int64_t arg) {
52873 LDKu8slice ser_ref;
52874 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
52875 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
52876 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
52877 *ret_conv = FixedPenaltyScorer_read(ser_ref, arg);
52878 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
52879 return tag_ptr(ret_conv, true);
52882 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
52883 LDKProbabilisticScorer this_obj_conv;
52884 this_obj_conv.inner = untag_ptr(this_obj);
52885 this_obj_conv.is_owned = ptr_is_owned(this_obj);
52886 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
52887 ProbabilisticScorer_free(this_obj_conv);
52890 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
52891 LDKProbabilisticScoringParameters this_obj_conv;
52892 this_obj_conv.inner = untag_ptr(this_obj);
52893 this_obj_conv.is_owned = ptr_is_owned(this_obj);
52894 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
52895 ProbabilisticScoringParameters_free(this_obj_conv);
52898 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
52899 LDKProbabilisticScoringParameters this_ptr_conv;
52900 this_ptr_conv.inner = untag_ptr(this_ptr);
52901 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52902 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52903 this_ptr_conv.is_owned = false;
52904 int64_t ret_conv = ProbabilisticScoringParameters_get_base_penalty_msat(&this_ptr_conv);
52908 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1base_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
52909 LDKProbabilisticScoringParameters this_ptr_conv;
52910 this_ptr_conv.inner = untag_ptr(this_ptr);
52911 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52912 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52913 this_ptr_conv.is_owned = false;
52914 ProbabilisticScoringParameters_set_base_penalty_msat(&this_ptr_conv, val);
52917 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1base_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
52918 LDKProbabilisticScoringParameters this_ptr_conv;
52919 this_ptr_conv.inner = untag_ptr(this_ptr);
52920 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52921 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52922 this_ptr_conv.is_owned = false;
52923 int64_t ret_conv = ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(&this_ptr_conv);
52927 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) {
52928 LDKProbabilisticScoringParameters this_ptr_conv;
52929 this_ptr_conv.inner = untag_ptr(this_ptr);
52930 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52931 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52932 this_ptr_conv.is_owned = false;
52933 ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(&this_ptr_conv, val);
52936 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
52937 LDKProbabilisticScoringParameters this_ptr_conv;
52938 this_ptr_conv.inner = untag_ptr(this_ptr);
52939 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52940 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52941 this_ptr_conv.is_owned = false;
52942 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(&this_ptr_conv);
52946 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) {
52947 LDKProbabilisticScoringParameters this_ptr_conv;
52948 this_ptr_conv.inner = untag_ptr(this_ptr);
52949 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52950 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52951 this_ptr_conv.is_owned = false;
52952 ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(&this_ptr_conv, val);
52955 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1liquidity_1offset_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) {
52956 LDKProbabilisticScoringParameters this_ptr_conv;
52957 this_ptr_conv.inner = untag_ptr(this_ptr);
52958 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52959 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52960 this_ptr_conv.is_owned = false;
52961 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_offset_half_life(&this_ptr_conv);
52965 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) {
52966 LDKProbabilisticScoringParameters this_ptr_conv;
52967 this_ptr_conv.inner = untag_ptr(this_ptr);
52968 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52969 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52970 this_ptr_conv.is_owned = false;
52971 ProbabilisticScoringParameters_set_liquidity_offset_half_life(&this_ptr_conv, val);
52974 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
52975 LDKProbabilisticScoringParameters this_ptr_conv;
52976 this_ptr_conv.inner = untag_ptr(this_ptr);
52977 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52978 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52979 this_ptr_conv.is_owned = false;
52980 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv);
52984 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) {
52985 LDKProbabilisticScoringParameters this_ptr_conv;
52986 this_ptr_conv.inner = untag_ptr(this_ptr);
52987 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52988 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52989 this_ptr_conv.is_owned = false;
52990 ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val);
52993 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1historical_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
52994 LDKProbabilisticScoringParameters this_ptr_conv;
52995 this_ptr_conv.inner = untag_ptr(this_ptr);
52996 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
52997 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
52998 this_ptr_conv.is_owned = false;
52999 int64_t ret_conv = ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv);
53003 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) {
53004 LDKProbabilisticScoringParameters this_ptr_conv;
53005 this_ptr_conv.inner = untag_ptr(this_ptr);
53006 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
53007 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
53008 this_ptr_conv.is_owned = false;
53009 ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv, val);
53012 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) {
53013 LDKProbabilisticScoringParameters this_ptr_conv;
53014 this_ptr_conv.inner = untag_ptr(this_ptr);
53015 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
53016 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
53017 this_ptr_conv.is_owned = false;
53018 int64_t ret_conv = ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv);
53022 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) {
53023 LDKProbabilisticScoringParameters this_ptr_conv;
53024 this_ptr_conv.inner = untag_ptr(this_ptr);
53025 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
53026 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
53027 this_ptr_conv.is_owned = false;
53028 ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val);
53031 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1historical_1no_1updates_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) {
53032 LDKProbabilisticScoringParameters this_ptr_conv;
53033 this_ptr_conv.inner = untag_ptr(this_ptr);
53034 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
53035 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
53036 this_ptr_conv.is_owned = false;
53037 int64_t ret_conv = ProbabilisticScoringParameters_get_historical_no_updates_half_life(&this_ptr_conv);
53041 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) {
53042 LDKProbabilisticScoringParameters this_ptr_conv;
53043 this_ptr_conv.inner = untag_ptr(this_ptr);
53044 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
53045 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
53046 this_ptr_conv.is_owned = false;
53047 ProbabilisticScoringParameters_set_historical_no_updates_half_life(&this_ptr_conv, val);
53050 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1anti_1probing_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
53051 LDKProbabilisticScoringParameters this_ptr_conv;
53052 this_ptr_conv.inner = untag_ptr(this_ptr);
53053 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
53054 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
53055 this_ptr_conv.is_owned = false;
53056 int64_t ret_conv = ProbabilisticScoringParameters_get_anti_probing_penalty_msat(&this_ptr_conv);
53060 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) {
53061 LDKProbabilisticScoringParameters this_ptr_conv;
53062 this_ptr_conv.inner = untag_ptr(this_ptr);
53063 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
53064 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
53065 this_ptr_conv.is_owned = false;
53066 ProbabilisticScoringParameters_set_anti_probing_penalty_msat(&this_ptr_conv, val);
53069 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1considered_1impossible_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
53070 LDKProbabilisticScoringParameters this_ptr_conv;
53071 this_ptr_conv.inner = untag_ptr(this_ptr);
53072 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
53073 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
53074 this_ptr_conv.is_owned = false;
53075 int64_t ret_conv = ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(&this_ptr_conv);
53079 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) {
53080 LDKProbabilisticScoringParameters this_ptr_conv;
53081 this_ptr_conv.inner = untag_ptr(this_ptr);
53082 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
53083 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
53084 this_ptr_conv.is_owned = false;
53085 ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(&this_ptr_conv, val);
53088 static inline uint64_t ProbabilisticScoringParameters_clone_ptr(LDKProbabilisticScoringParameters *NONNULL_PTR arg) {
53089 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_clone(arg);
53090 int64_t ret_ref = 0;
53091 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53092 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53095 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
53096 LDKProbabilisticScoringParameters arg_conv;
53097 arg_conv.inner = untag_ptr(arg);
53098 arg_conv.is_owned = ptr_is_owned(arg);
53099 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
53100 arg_conv.is_owned = false;
53101 int64_t ret_conv = ProbabilisticScoringParameters_clone_ptr(&arg_conv);
53105 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1clone(JNIEnv *env, jclass clz, int64_t orig) {
53106 LDKProbabilisticScoringParameters orig_conv;
53107 orig_conv.inner = untag_ptr(orig);
53108 orig_conv.is_owned = ptr_is_owned(orig);
53109 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
53110 orig_conv.is_owned = false;
53111 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_clone(&orig_conv);
53112 int64_t ret_ref = 0;
53113 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53114 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53118 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) {
53119 LDKProbabilisticScoringParameters params_conv;
53120 params_conv.inner = untag_ptr(params);
53121 params_conv.is_owned = ptr_is_owned(params);
53122 CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
53123 params_conv = ProbabilisticScoringParameters_clone(¶ms_conv);
53124 LDKNetworkGraph network_graph_conv;
53125 network_graph_conv.inner = untag_ptr(network_graph);
53126 network_graph_conv.is_owned = ptr_is_owned(network_graph);
53127 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
53128 network_graph_conv.is_owned = false;
53129 void* logger_ptr = untag_ptr(logger);
53130 CHECK_ACCESS(logger_ptr);
53131 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
53132 if (logger_conv.free == LDKLogger_JCalls_free) {
53133 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
53134 LDKLogger_JCalls_cloned(&logger_conv);
53136 LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(params_conv, &network_graph_conv, logger_conv);
53137 int64_t ret_ref = 0;
53138 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53139 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53143 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1debug_1log_1liquidity_1stats(JNIEnv *env, jclass clz, int64_t this_arg) {
53144 LDKProbabilisticScorer this_arg_conv;
53145 this_arg_conv.inner = untag_ptr(this_arg);
53146 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53147 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53148 this_arg_conv.is_owned = false;
53149 ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv);
53152 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) {
53153 LDKProbabilisticScorer this_arg_conv;
53154 this_arg_conv.inner = untag_ptr(this_arg);
53155 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53156 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53157 this_arg_conv.is_owned = false;
53158 LDKNodeId target_conv;
53159 target_conv.inner = untag_ptr(target);
53160 target_conv.is_owned = ptr_is_owned(target);
53161 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
53162 target_conv.is_owned = false;
53163 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
53164 *ret_copy = ProbabilisticScorer_estimated_channel_liquidity_range(&this_arg_conv, scid, &target_conv);
53165 int64_t ret_ref = tag_ptr(ret_copy, true);
53169 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) {
53170 LDKProbabilisticScorer this_arg_conv;
53171 this_arg_conv.inner = untag_ptr(this_arg);
53172 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53173 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53174 this_arg_conv.is_owned = false;
53175 LDKNodeId target_conv;
53176 target_conv.inner = untag_ptr(target);
53177 target_conv.is_owned = ptr_is_owned(target);
53178 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
53179 target_conv.is_owned = false;
53180 LDKCOption_C2Tuple_EightU16sEightU16sZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_EightU16sEightU16sZZ), "LDKCOption_C2Tuple_EightU16sEightU16sZZ");
53181 *ret_copy = ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(&this_arg_conv, scid, &target_conv);
53182 int64_t ret_ref = tag_ptr(ret_copy, true);
53186 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1add_1banned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) {
53187 LDKProbabilisticScorer this_arg_conv;
53188 this_arg_conv.inner = untag_ptr(this_arg);
53189 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53190 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53191 this_arg_conv.is_owned = false;
53192 LDKNodeId node_id_conv;
53193 node_id_conv.inner = untag_ptr(node_id);
53194 node_id_conv.is_owned = ptr_is_owned(node_id);
53195 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
53196 node_id_conv.is_owned = false;
53197 ProbabilisticScorer_add_banned(&this_arg_conv, &node_id_conv);
53200 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1remove_1banned(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) {
53201 LDKProbabilisticScorer this_arg_conv;
53202 this_arg_conv.inner = untag_ptr(this_arg);
53203 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53204 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53205 this_arg_conv.is_owned = false;
53206 LDKNodeId node_id_conv;
53207 node_id_conv.inner = untag_ptr(node_id);
53208 node_id_conv.is_owned = ptr_is_owned(node_id);
53209 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
53210 node_id_conv.is_owned = false;
53211 ProbabilisticScorer_remove_banned(&this_arg_conv, &node_id_conv);
53214 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) {
53215 LDKProbabilisticScorer this_arg_conv;
53216 this_arg_conv.inner = untag_ptr(this_arg);
53217 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53218 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53219 this_arg_conv.is_owned = false;
53220 LDKNodeId node_id_conv;
53221 node_id_conv.inner = untag_ptr(node_id);
53222 node_id_conv.is_owned = ptr_is_owned(node_id);
53223 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
53224 node_id_conv.is_owned = false;
53225 ProbabilisticScorer_set_manual_penalty(&this_arg_conv, &node_id_conv, penalty);
53228 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1remove_1manual_1penalty(JNIEnv *env, jclass clz, int64_t this_arg, int64_t node_id) {
53229 LDKProbabilisticScorer this_arg_conv;
53230 this_arg_conv.inner = untag_ptr(this_arg);
53231 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53232 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53233 this_arg_conv.is_owned = false;
53234 LDKNodeId node_id_conv;
53235 node_id_conv.inner = untag_ptr(node_id);
53236 node_id_conv.is_owned = ptr_is_owned(node_id);
53237 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
53238 node_id_conv.is_owned = false;
53239 ProbabilisticScorer_remove_manual_penalty(&this_arg_conv, &node_id_conv);
53242 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1clear_1manual_1penalties(JNIEnv *env, jclass clz, int64_t this_arg) {
53243 LDKProbabilisticScorer this_arg_conv;
53244 this_arg_conv.inner = untag_ptr(this_arg);
53245 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53246 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53247 this_arg_conv.is_owned = false;
53248 ProbabilisticScorer_clear_manual_penalties(&this_arg_conv);
53251 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) {
53252 LDKProbabilisticScoringParameters this_arg_conv;
53253 this_arg_conv.inner = untag_ptr(this_arg);
53254 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53255 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53256 this_arg_conv.is_owned = false;
53257 LDKCVec_NodeIdZ node_ids_constr;
53258 node_ids_constr.datalen = (*env)->GetArrayLength(env, node_ids);
53259 if (node_ids_constr.datalen > 0)
53260 node_ids_constr.data = MALLOC(node_ids_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements");
53262 node_ids_constr.data = NULL;
53263 int64_t* node_ids_vals = (*env)->GetLongArrayElements (env, node_ids, NULL);
53264 for (size_t i = 0; i < node_ids_constr.datalen; i++) {
53265 int64_t node_ids_conv_8 = node_ids_vals[i];
53266 LDKNodeId node_ids_conv_8_conv;
53267 node_ids_conv_8_conv.inner = untag_ptr(node_ids_conv_8);
53268 node_ids_conv_8_conv.is_owned = ptr_is_owned(node_ids_conv_8);
53269 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_ids_conv_8_conv);
53270 node_ids_conv_8_conv = NodeId_clone(&node_ids_conv_8_conv);
53271 node_ids_constr.data[i] = node_ids_conv_8_conv;
53273 (*env)->ReleaseLongArrayElements(env, node_ids, node_ids_vals, 0);
53274 ProbabilisticScoringParameters_add_banned_from_list(&this_arg_conv, node_ids_constr);
53277 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1default(JNIEnv *env, jclass clz) {
53278 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_default();
53279 int64_t ret_ref = 0;
53280 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53281 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53285 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) {
53286 LDKProbabilisticScorer this_arg_conv;
53287 this_arg_conv.inner = untag_ptr(this_arg);
53288 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53289 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53290 this_arg_conv.is_owned = false;
53291 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
53292 *ret_ret = ProbabilisticScorer_as_Score(&this_arg_conv);
53293 return tag_ptr(ret_ret, true);
53296 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1write(JNIEnv *env, jclass clz, int64_t obj) {
53297 LDKProbabilisticScorer obj_conv;
53298 obj_conv.inner = untag_ptr(obj);
53299 obj_conv.is_owned = ptr_is_owned(obj);
53300 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
53301 obj_conv.is_owned = false;
53302 LDKCVec_u8Z ret_var = ProbabilisticScorer_write(&obj_conv);
53303 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
53304 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
53305 CVec_u8Z_free(ret_var);
53309 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) {
53310 LDKu8slice ser_ref;
53311 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
53312 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
53313 LDKProbabilisticScoringParameters arg_a_conv;
53314 arg_a_conv.inner = untag_ptr(arg_a);
53315 arg_a_conv.is_owned = ptr_is_owned(arg_a);
53316 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_a_conv);
53317 arg_a_conv = ProbabilisticScoringParameters_clone(&arg_a_conv);
53318 LDKNetworkGraph arg_b_conv;
53319 arg_b_conv.inner = untag_ptr(arg_b);
53320 arg_b_conv.is_owned = ptr_is_owned(arg_b);
53321 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv);
53322 arg_b_conv.is_owned = false;
53323 void* arg_c_ptr = untag_ptr(arg_c);
53324 CHECK_ACCESS(arg_c_ptr);
53325 LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr);
53326 if (arg_c_conv.free == LDKLogger_JCalls_free) {
53327 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
53328 LDKLogger_JCalls_cloned(&arg_c_conv);
53330 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
53331 *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv);
53332 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
53333 return tag_ptr(ret_conv, true);
53336 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
53337 LDKOnionMessenger this_obj_conv;
53338 this_obj_conv.inner = untag_ptr(this_obj);
53339 this_obj_conv.is_owned = ptr_is_owned(this_obj);
53340 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
53341 OnionMessenger_free(this_obj_conv);
53344 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Destination_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
53345 if (!ptr_is_owned(this_ptr)) return;
53346 void* this_ptr_ptr = untag_ptr(this_ptr);
53347 CHECK_ACCESS(this_ptr_ptr);
53348 LDKDestination this_ptr_conv = *(LDKDestination*)(this_ptr_ptr);
53349 FREE(untag_ptr(this_ptr));
53350 Destination_free(this_ptr_conv);
53353 static inline uint64_t Destination_clone_ptr(LDKDestination *NONNULL_PTR arg) {
53354 LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination");
53355 *ret_copy = Destination_clone(arg);
53356 int64_t ret_ref = tag_ptr(ret_copy, true);
53359 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
53360 LDKDestination* arg_conv = (LDKDestination*)untag_ptr(arg);
53361 int64_t ret_conv = Destination_clone_ptr(arg_conv);
53365 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1clone(JNIEnv *env, jclass clz, int64_t orig) {
53366 LDKDestination* orig_conv = (LDKDestination*)untag_ptr(orig);
53367 LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination");
53368 *ret_copy = Destination_clone(orig_conv);
53369 int64_t ret_ref = tag_ptr(ret_copy, true);
53373 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1node(JNIEnv *env, jclass clz, int8_tArray a) {
53374 LDKPublicKey a_ref;
53375 CHECK((*env)->GetArrayLength(env, a) == 33);
53376 (*env)->GetByteArrayRegion(env, a, 0, 33, a_ref.compressed_form);
53377 LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination");
53378 *ret_copy = Destination_node(a_ref);
53379 int64_t ret_ref = tag_ptr(ret_copy, true);
53383 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1blinded_1path(JNIEnv *env, jclass clz, int64_t a) {
53384 LDKBlindedPath a_conv;
53385 a_conv.inner = untag_ptr(a);
53386 a_conv.is_owned = ptr_is_owned(a);
53387 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
53388 a_conv = BlindedPath_clone(&a_conv);
53389 LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination");
53390 *ret_copy = Destination_blinded_path(a_conv);
53391 int64_t ret_ref = tag_ptr(ret_copy, true);
53395 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SendError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
53396 if (!ptr_is_owned(this_ptr)) return;
53397 void* this_ptr_ptr = untag_ptr(this_ptr);
53398 CHECK_ACCESS(this_ptr_ptr);
53399 LDKSendError this_ptr_conv = *(LDKSendError*)(this_ptr_ptr);
53400 FREE(untag_ptr(this_ptr));
53401 SendError_free(this_ptr_conv);
53404 static inline uint64_t SendError_clone_ptr(LDKSendError *NONNULL_PTR arg) {
53405 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
53406 *ret_copy = SendError_clone(arg);
53407 int64_t ret_ref = tag_ptr(ret_copy, true);
53410 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
53411 LDKSendError* arg_conv = (LDKSendError*)untag_ptr(arg);
53412 int64_t ret_conv = SendError_clone_ptr(arg_conv);
53416 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
53417 LDKSendError* orig_conv = (LDKSendError*)untag_ptr(orig);
53418 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
53419 *ret_copy = SendError_clone(orig_conv);
53420 int64_t ret_ref = tag_ptr(ret_copy, true);
53424 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1secp256k1(JNIEnv *env, jclass clz, jclass a) {
53425 LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_java(env, a);
53426 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
53427 *ret_copy = SendError_secp256k1(a_conv);
53428 int64_t ret_ref = tag_ptr(ret_copy, true);
53432 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1too_1big_1packet(JNIEnv *env, jclass clz) {
53433 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
53434 *ret_copy = SendError_too_big_packet();
53435 int64_t ret_ref = tag_ptr(ret_copy, true);
53439 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1too_1few_1blinded_1hops(JNIEnv *env, jclass clz) {
53440 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
53441 *ret_copy = SendError_too_few_blinded_hops();
53442 int64_t ret_ref = tag_ptr(ret_copy, true);
53446 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1first_1hop(JNIEnv *env, jclass clz) {
53447 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
53448 *ret_copy = SendError_invalid_first_hop();
53449 int64_t ret_ref = tag_ptr(ret_copy, true);
53453 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1message(JNIEnv *env, jclass clz) {
53454 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
53455 *ret_copy = SendError_invalid_message();
53456 int64_t ret_ref = tag_ptr(ret_copy, true);
53460 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1buffer_1full(JNIEnv *env, jclass clz) {
53461 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
53462 *ret_copy = SendError_buffer_full();
53463 int64_t ret_ref = tag_ptr(ret_copy, true);
53467 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1get_1node_1id_1failed(JNIEnv *env, jclass clz) {
53468 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
53469 *ret_copy = SendError_get_node_id_failed();
53470 int64_t ret_ref = tag_ptr(ret_copy, true);
53474 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1blinded_1path_1advance_1failed(JNIEnv *env, jclass clz) {
53475 LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
53476 *ret_copy = SendError_blinded_path_advance_failed();
53477 int64_t ret_ref = tag_ptr(ret_copy, true);
53481 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
53482 LDKSendError* a_conv = (LDKSendError*)untag_ptr(a);
53483 LDKSendError* b_conv = (LDKSendError*)untag_ptr(b);
53484 jboolean ret_conv = SendError_eq(a_conv, b_conv);
53488 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
53489 if (!ptr_is_owned(this_ptr)) return;
53490 void* this_ptr_ptr = untag_ptr(this_ptr);
53491 CHECK_ACCESS(this_ptr_ptr);
53492 LDKCustomOnionMessageHandler this_ptr_conv = *(LDKCustomOnionMessageHandler*)(this_ptr_ptr);
53493 FREE(untag_ptr(this_ptr));
53494 CustomOnionMessageHandler_free(this_ptr_conv);
53497 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) {
53498 void* entropy_source_ptr = untag_ptr(entropy_source);
53499 CHECK_ACCESS(entropy_source_ptr);
53500 LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr);
53501 if (entropy_source_conv.free == LDKEntropySource_JCalls_free) {
53502 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
53503 LDKEntropySource_JCalls_cloned(&entropy_source_conv);
53505 void* node_signer_ptr = untag_ptr(node_signer);
53506 CHECK_ACCESS(node_signer_ptr);
53507 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
53508 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
53509 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
53510 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
53512 void* logger_ptr = untag_ptr(logger);
53513 CHECK_ACCESS(logger_ptr);
53514 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
53515 if (logger_conv.free == LDKLogger_JCalls_free) {
53516 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
53517 LDKLogger_JCalls_cloned(&logger_conv);
53519 void* custom_handler_ptr = untag_ptr(custom_handler);
53520 CHECK_ACCESS(custom_handler_ptr);
53521 LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr);
53522 if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) {
53523 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
53524 LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv);
53526 LDKOnionMessenger ret_var = OnionMessenger_new(entropy_source_conv, node_signer_conv, logger_conv, custom_handler_conv);
53527 int64_t ret_ref = 0;
53528 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53529 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53533 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) {
53534 LDKOnionMessenger this_arg_conv;
53535 this_arg_conv.inner = untag_ptr(this_arg);
53536 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53537 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53538 this_arg_conv.is_owned = false;
53539 LDKCVec_PublicKeyZ intermediate_nodes_constr;
53540 intermediate_nodes_constr.datalen = (*env)->GetArrayLength(env, intermediate_nodes);
53541 if (intermediate_nodes_constr.datalen > 0)
53542 intermediate_nodes_constr.data = MALLOC(intermediate_nodes_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
53544 intermediate_nodes_constr.data = NULL;
53545 for (size_t i = 0; i < intermediate_nodes_constr.datalen; i++) {
53546 int8_tArray intermediate_nodes_conv_8 = (*env)->GetObjectArrayElement(env, intermediate_nodes, i);
53547 LDKPublicKey intermediate_nodes_conv_8_ref;
53548 CHECK((*env)->GetArrayLength(env, intermediate_nodes_conv_8) == 33);
53549 (*env)->GetByteArrayRegion(env, intermediate_nodes_conv_8, 0, 33, intermediate_nodes_conv_8_ref.compressed_form);
53550 intermediate_nodes_constr.data[i] = intermediate_nodes_conv_8_ref;
53552 void* destination_ptr = untag_ptr(destination);
53553 CHECK_ACCESS(destination_ptr);
53554 LDKDestination destination_conv = *(LDKDestination*)(destination_ptr);
53555 destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination));
53556 void* message_ptr = untag_ptr(message);
53557 CHECK_ACCESS(message_ptr);
53558 LDKOnionMessageContents message_conv = *(LDKOnionMessageContents*)(message_ptr);
53559 message_conv = OnionMessageContents_clone((LDKOnionMessageContents*)untag_ptr(message));
53560 LDKBlindedPath reply_path_conv;
53561 reply_path_conv.inner = untag_ptr(reply_path);
53562 reply_path_conv.is_owned = ptr_is_owned(reply_path);
53563 CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv);
53564 reply_path_conv = BlindedPath_clone(&reply_path_conv);
53565 LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
53566 *ret_conv = OnionMessenger_send_onion_message(&this_arg_conv, intermediate_nodes_constr, destination_conv, message_conv, reply_path_conv);
53567 return tag_ptr(ret_conv, true);
53570 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1OnionMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
53571 LDKOnionMessenger this_arg_conv;
53572 this_arg_conv.inner = untag_ptr(this_arg);
53573 this_arg_conv.is_owned = ptr_is_owned(this_arg);
53574 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
53575 this_arg_conv.is_owned = false;
53576 LDKOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKOnionMessageHandler), "LDKOnionMessageHandler");
53577 *ret_ret = OnionMessenger_as_OnionMessageHandler(&this_arg_conv);
53578 return tag_ptr(ret_ret, true);
53581 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1OnionMessageProvider(JNIEnv *env, jclass clz, int64_t this_arg) {
53582 LDKOnionMessenger 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.is_owned = false;
53587 LDKOnionMessageProvider* ret_ret = MALLOC(sizeof(LDKOnionMessageProvider), "LDKOnionMessageProvider");
53588 *ret_ret = OnionMessenger_as_OnionMessageProvider(&this_arg_conv);
53589 return tag_ptr(ret_ret, true);
53592 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
53593 if (!ptr_is_owned(this_ptr)) return;
53594 void* this_ptr_ptr = untag_ptr(this_ptr);
53595 CHECK_ACCESS(this_ptr_ptr);
53596 LDKOnionMessageContents this_ptr_conv = *(LDKOnionMessageContents*)(this_ptr_ptr);
53597 FREE(untag_ptr(this_ptr));
53598 OnionMessageContents_free(this_ptr_conv);
53601 static inline uint64_t OnionMessageContents_clone_ptr(LDKOnionMessageContents *NONNULL_PTR arg) {
53602 LDKOnionMessageContents *ret_copy = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents");
53603 *ret_copy = OnionMessageContents_clone(arg);
53604 int64_t ret_ref = tag_ptr(ret_copy, true);
53607 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
53608 LDKOnionMessageContents* arg_conv = (LDKOnionMessageContents*)untag_ptr(arg);
53609 int64_t ret_conv = OnionMessageContents_clone_ptr(arg_conv);
53613 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone(JNIEnv *env, jclass clz, int64_t orig) {
53614 LDKOnionMessageContents* orig_conv = (LDKOnionMessageContents*)untag_ptr(orig);
53615 LDKOnionMessageContents *ret_copy = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents");
53616 *ret_copy = OnionMessageContents_clone(orig_conv);
53617 int64_t ret_ref = tag_ptr(ret_copy, true);
53621 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1custom(JNIEnv *env, jclass clz, int64_t a) {
53622 void* a_ptr = untag_ptr(a);
53623 CHECK_ACCESS(a_ptr);
53624 LDKCustomOnionMessageContents a_conv = *(LDKCustomOnionMessageContents*)(a_ptr);
53625 if (a_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
53626 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
53627 LDKCustomOnionMessageContents_JCalls_cloned(&a_conv);
53629 LDKOnionMessageContents *ret_copy = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents");
53630 *ret_copy = OnionMessageContents_custom(a_conv);
53631 int64_t ret_ref = tag_ptr(ret_copy, true);
53635 static inline uint64_t CustomOnionMessageContents_clone_ptr(LDKCustomOnionMessageContents *NONNULL_PTR arg) {
53636 LDKCustomOnionMessageContents* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
53637 *ret_ret = CustomOnionMessageContents_clone(arg);
53638 return tag_ptr(ret_ret, true);
53640 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
53641 void* arg_ptr = untag_ptr(arg);
53642 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
53643 LDKCustomOnionMessageContents* arg_conv = (LDKCustomOnionMessageContents*)arg_ptr;
53644 int64_t ret_conv = CustomOnionMessageContents_clone_ptr(arg_conv);
53648 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1clone(JNIEnv *env, jclass clz, int64_t orig) {
53649 void* orig_ptr = untag_ptr(orig);
53650 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
53651 LDKCustomOnionMessageContents* orig_conv = (LDKCustomOnionMessageContents*)orig_ptr;
53652 LDKCustomOnionMessageContents* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
53653 *ret_ret = CustomOnionMessageContents_clone(orig_conv);
53654 return tag_ptr(ret_ret, true);
53657 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
53658 if (!ptr_is_owned(this_ptr)) return;
53659 void* this_ptr_ptr = untag_ptr(this_ptr);
53660 CHECK_ACCESS(this_ptr_ptr);
53661 LDKCustomOnionMessageContents this_ptr_conv = *(LDKCustomOnionMessageContents*)(this_ptr_ptr);
53662 FREE(untag_ptr(this_ptr));
53663 CustomOnionMessageContents_free(this_ptr_conv);
53666 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPath_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
53667 LDKBlindedPath this_obj_conv;
53668 this_obj_conv.inner = untag_ptr(this_obj);
53669 this_obj_conv.is_owned = ptr_is_owned(this_obj);
53670 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
53671 BlindedPath_free(this_obj_conv);
53674 static inline uint64_t BlindedPath_clone_ptr(LDKBlindedPath *NONNULL_PTR arg) {
53675 LDKBlindedPath ret_var = BlindedPath_clone(arg);
53676 int64_t ret_ref = 0;
53677 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53678 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53681 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
53682 LDKBlindedPath arg_conv;
53683 arg_conv.inner = untag_ptr(arg);
53684 arg_conv.is_owned = ptr_is_owned(arg);
53685 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
53686 arg_conv.is_owned = false;
53687 int64_t ret_conv = BlindedPath_clone_ptr(&arg_conv);
53691 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1clone(JNIEnv *env, jclass clz, int64_t orig) {
53692 LDKBlindedPath orig_conv;
53693 orig_conv.inner = untag_ptr(orig);
53694 orig_conv.is_owned = ptr_is_owned(orig);
53695 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
53696 orig_conv.is_owned = false;
53697 LDKBlindedPath ret_var = BlindedPath_clone(&orig_conv);
53698 int64_t ret_ref = 0;
53699 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53700 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53704 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1hash(JNIEnv *env, jclass clz, int64_t o) {
53705 LDKBlindedPath o_conv;
53706 o_conv.inner = untag_ptr(o);
53707 o_conv.is_owned = ptr_is_owned(o);
53708 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
53709 o_conv.is_owned = false;
53710 int64_t ret_conv = BlindedPath_hash(&o_conv);
53714 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedPath_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
53715 LDKBlindedPath a_conv;
53716 a_conv.inner = untag_ptr(a);
53717 a_conv.is_owned = ptr_is_owned(a);
53718 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
53719 a_conv.is_owned = false;
53720 LDKBlindedPath b_conv;
53721 b_conv.inner = untag_ptr(b);
53722 b_conv.is_owned = ptr_is_owned(b);
53723 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
53724 b_conv.is_owned = false;
53725 jboolean ret_conv = BlindedPath_eq(&a_conv, &b_conv);
53729 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
53730 LDKBlindedHop this_obj_conv;
53731 this_obj_conv.inner = untag_ptr(this_obj);
53732 this_obj_conv.is_owned = ptr_is_owned(this_obj);
53733 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
53734 BlindedHop_free(this_obj_conv);
53737 static inline uint64_t BlindedHop_clone_ptr(LDKBlindedHop *NONNULL_PTR arg) {
53738 LDKBlindedHop ret_var = BlindedHop_clone(arg);
53739 int64_t ret_ref = 0;
53740 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53741 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53744 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
53745 LDKBlindedHop arg_conv;
53746 arg_conv.inner = untag_ptr(arg);
53747 arg_conv.is_owned = ptr_is_owned(arg);
53748 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
53749 arg_conv.is_owned = false;
53750 int64_t ret_conv = BlindedHop_clone_ptr(&arg_conv);
53754 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone(JNIEnv *env, jclass clz, int64_t orig) {
53755 LDKBlindedHop orig_conv;
53756 orig_conv.inner = untag_ptr(orig);
53757 orig_conv.is_owned = ptr_is_owned(orig);
53758 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
53759 orig_conv.is_owned = false;
53760 LDKBlindedHop ret_var = BlindedHop_clone(&orig_conv);
53761 int64_t ret_ref = 0;
53762 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
53763 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
53767 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1hash(JNIEnv *env, jclass clz, int64_t o) {
53768 LDKBlindedHop o_conv;
53769 o_conv.inner = untag_ptr(o);
53770 o_conv.is_owned = ptr_is_owned(o);
53771 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
53772 o_conv.is_owned = false;
53773 int64_t ret_conv = BlindedHop_hash(&o_conv);
53777 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlindedHop_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
53778 LDKBlindedHop a_conv;
53779 a_conv.inner = untag_ptr(a);
53780 a_conv.is_owned = ptr_is_owned(a);
53781 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
53782 a_conv.is_owned = false;
53783 LDKBlindedHop b_conv;
53784 b_conv.inner = untag_ptr(b);
53785 b_conv.is_owned = ptr_is_owned(b);
53786 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
53787 b_conv.is_owned = false;
53788 jboolean ret_conv = BlindedHop_eq(&a_conv, &b_conv);
53792 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1new_1for_1message(JNIEnv *env, jclass clz, jobjectArray node_pks, int64_t entropy_source) {
53793 LDKCVec_PublicKeyZ node_pks_constr;
53794 node_pks_constr.datalen = (*env)->GetArrayLength(env, node_pks);
53795 if (node_pks_constr.datalen > 0)
53796 node_pks_constr.data = MALLOC(node_pks_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
53798 node_pks_constr.data = NULL;
53799 for (size_t i = 0; i < node_pks_constr.datalen; i++) {
53800 int8_tArray node_pks_conv_8 = (*env)->GetObjectArrayElement(env, node_pks, i);
53801 LDKPublicKey node_pks_conv_8_ref;
53802 CHECK((*env)->GetArrayLength(env, node_pks_conv_8) == 33);
53803 (*env)->GetByteArrayRegion(env, node_pks_conv_8, 0, 33, node_pks_conv_8_ref.compressed_form);
53804 node_pks_constr.data[i] = node_pks_conv_8_ref;
53806 void* entropy_source_ptr = untag_ptr(entropy_source);
53807 if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); }
53808 LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr;
53809 LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ");
53810 *ret_conv = BlindedPath_new_for_message(node_pks_constr, entropy_source_conv);
53811 return tag_ptr(ret_conv, true);
53814 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedPath_1write(JNIEnv *env, jclass clz, int64_t obj) {
53815 LDKBlindedPath obj_conv;
53816 obj_conv.inner = untag_ptr(obj);
53817 obj_conv.is_owned = ptr_is_owned(obj);
53818 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
53819 obj_conv.is_owned = false;
53820 LDKCVec_u8Z ret_var = BlindedPath_write(&obj_conv);
53821 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
53822 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
53823 CVec_u8Z_free(ret_var);
53827 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
53828 LDKu8slice ser_ref;
53829 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
53830 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
53831 LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ");
53832 *ret_conv = BlindedPath_read(ser_ref);
53833 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
53834 return tag_ptr(ret_conv, true);
53837 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedHop_1write(JNIEnv *env, jclass clz, int64_t obj) {
53838 LDKBlindedHop obj_conv;
53839 obj_conv.inner = untag_ptr(obj);
53840 obj_conv.is_owned = ptr_is_owned(obj);
53841 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
53842 obj_conv.is_owned = false;
53843 LDKCVec_u8Z ret_var = BlindedHop_write(&obj_conv);
53844 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
53845 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
53846 CVec_u8Z_free(ret_var);
53850 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
53851 LDKu8slice ser_ref;
53852 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
53853 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
53854 LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
53855 *ret_conv = BlindedHop_read(ser_ref);
53856 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
53857 return tag_ptr(ret_conv, true);
53860 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
53861 if (!ptr_is_owned(this_ptr)) return;
53862 void* this_ptr_ptr = untag_ptr(this_ptr);
53863 CHECK_ACCESS(this_ptr_ptr);
53864 LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr);
53865 FREE(untag_ptr(this_ptr));
53866 PaymentPurpose_free(this_ptr_conv);
53869 static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) {
53870 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
53871 *ret_copy = PaymentPurpose_clone(arg);
53872 int64_t ret_ref = tag_ptr(ret_copy, true);
53875 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
53876 LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)untag_ptr(arg);
53877 int64_t ret_conv = PaymentPurpose_clone_ptr(arg_conv);
53881 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone(JNIEnv *env, jclass clz, int64_t orig) {
53882 LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)untag_ptr(orig);
53883 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
53884 *ret_copy = PaymentPurpose_clone(orig_conv);
53885 int64_t ret_ref = tag_ptr(ret_copy, true);
53889 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1invoice_1payment(JNIEnv *env, jclass clz, int8_tArray payment_preimage, int8_tArray payment_secret) {
53890 LDKThirtyTwoBytes payment_preimage_ref;
53891 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
53892 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
53893 LDKThirtyTwoBytes payment_secret_ref;
53894 CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
53895 (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
53896 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
53897 *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref);
53898 int64_t ret_ref = tag_ptr(ret_copy, true);
53902 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1spontaneous_1payment(JNIEnv *env, jclass clz, int8_tArray a) {
53903 LDKThirtyTwoBytes a_ref;
53904 CHECK((*env)->GetArrayLength(env, a) == 32);
53905 (*env)->GetByteArrayRegion(env, a, 0, 32, a_ref.data);
53906 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
53907 *ret_copy = PaymentPurpose_spontaneous_payment(a_ref);
53908 int64_t ret_ref = tag_ptr(ret_copy, true);
53912 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
53913 LDKPaymentPurpose* a_conv = (LDKPaymentPurpose*)untag_ptr(a);
53914 LDKPaymentPurpose* b_conv = (LDKPaymentPurpose*)untag_ptr(b);
53915 jboolean ret_conv = PaymentPurpose_eq(a_conv, b_conv);
53919 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1write(JNIEnv *env, jclass clz, int64_t obj) {
53920 LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)untag_ptr(obj);
53921 LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv);
53922 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
53923 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
53924 CVec_u8Z_free(ret_var);
53928 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
53929 LDKu8slice ser_ref;
53930 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
53931 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
53932 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
53933 *ret_conv = PaymentPurpose_read(ser_ref);
53934 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
53935 return tag_ptr(ret_conv, true);
53938 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PathFailure_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
53939 if (!ptr_is_owned(this_ptr)) return;
53940 void* this_ptr_ptr = untag_ptr(this_ptr);
53941 CHECK_ACCESS(this_ptr_ptr);
53942 LDKPathFailure this_ptr_conv = *(LDKPathFailure*)(this_ptr_ptr);
53943 FREE(untag_ptr(this_ptr));
53944 PathFailure_free(this_ptr_conv);
53947 static inline uint64_t PathFailure_clone_ptr(LDKPathFailure *NONNULL_PTR arg) {
53948 LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure");
53949 *ret_copy = PathFailure_clone(arg);
53950 int64_t ret_ref = tag_ptr(ret_copy, true);
53953 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
53954 LDKPathFailure* arg_conv = (LDKPathFailure*)untag_ptr(arg);
53955 int64_t ret_conv = PathFailure_clone_ptr(arg_conv);
53959 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1clone(JNIEnv *env, jclass clz, int64_t orig) {
53960 LDKPathFailure* orig_conv = (LDKPathFailure*)untag_ptr(orig);
53961 LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure");
53962 *ret_copy = PathFailure_clone(orig_conv);
53963 int64_t ret_ref = tag_ptr(ret_copy, true);
53967 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1initial_1send(JNIEnv *env, jclass clz, int64_t err) {
53968 void* err_ptr = untag_ptr(err);
53969 CHECK_ACCESS(err_ptr);
53970 LDKAPIError err_conv = *(LDKAPIError*)(err_ptr);
53971 err_conv = APIError_clone((LDKAPIError*)untag_ptr(err));
53972 LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure");
53973 *ret_copy = PathFailure_initial_send(err_conv);
53974 int64_t ret_ref = tag_ptr(ret_copy, true);
53978 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1on_1path(JNIEnv *env, jclass clz, int64_t network_update) {
53979 void* network_update_ptr = untag_ptr(network_update);
53980 CHECK_ACCESS(network_update_ptr);
53981 LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr);
53982 network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(network_update));
53983 LDKPathFailure *ret_copy = MALLOC(sizeof(LDKPathFailure), "LDKPathFailure");
53984 *ret_copy = PathFailure_on_path(network_update_conv);
53985 int64_t ret_ref = tag_ptr(ret_copy, true);
53989 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PathFailure_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
53990 LDKPathFailure* a_conv = (LDKPathFailure*)untag_ptr(a);
53991 LDKPathFailure* b_conv = (LDKPathFailure*)untag_ptr(b);
53992 jboolean ret_conv = PathFailure_eq(a_conv, b_conv);
53996 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PathFailure_1write(JNIEnv *env, jclass clz, int64_t obj) {
53997 LDKPathFailure* obj_conv = (LDKPathFailure*)untag_ptr(obj);
53998 LDKCVec_u8Z ret_var = PathFailure_write(obj_conv);
53999 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
54000 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
54001 CVec_u8Z_free(ret_var);
54005 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PathFailure_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
54006 LDKu8slice ser_ref;
54007 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
54008 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
54009 LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ");
54010 *ret_conv = PathFailure_read(ser_ref);
54011 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
54012 return tag_ptr(ret_conv, true);
54015 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosureReason_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
54016 if (!ptr_is_owned(this_ptr)) return;
54017 void* this_ptr_ptr = untag_ptr(this_ptr);
54018 CHECK_ACCESS(this_ptr_ptr);
54019 LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr);
54020 FREE(untag_ptr(this_ptr));
54021 ClosureReason_free(this_ptr_conv);
54024 static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) {
54025 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
54026 *ret_copy = ClosureReason_clone(arg);
54027 int64_t ret_ref = tag_ptr(ret_copy, true);
54030 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
54031 LDKClosureReason* arg_conv = (LDKClosureReason*)untag_ptr(arg);
54032 int64_t ret_conv = ClosureReason_clone_ptr(arg_conv);
54036 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1clone(JNIEnv *env, jclass clz, int64_t orig) {
54037 LDKClosureReason* orig_conv = (LDKClosureReason*)untag_ptr(orig);
54038 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
54039 *ret_copy = ClosureReason_clone(orig_conv);
54040 int64_t ret_ref = tag_ptr(ret_copy, true);
54044 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1counterparty_1force_1closed(JNIEnv *env, jclass clz, int64_t peer_msg) {
54045 LDKUntrustedString peer_msg_conv;
54046 peer_msg_conv.inner = untag_ptr(peer_msg);
54047 peer_msg_conv.is_owned = ptr_is_owned(peer_msg);
54048 CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_msg_conv);
54049 peer_msg_conv = UntrustedString_clone(&peer_msg_conv);
54050 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
54051 *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv);
54052 int64_t ret_ref = tag_ptr(ret_copy, true);
54056 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1holder_1force_1closed(JNIEnv *env, jclass clz) {
54057 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
54058 *ret_copy = ClosureReason_holder_force_closed();
54059 int64_t ret_ref = tag_ptr(ret_copy, true);
54063 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1cooperative_1closure(JNIEnv *env, jclass clz) {
54064 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
54065 *ret_copy = ClosureReason_cooperative_closure();
54066 int64_t ret_ref = tag_ptr(ret_copy, true);
54070 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1commitment_1tx_1confirmed(JNIEnv *env, jclass clz) {
54071 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
54072 *ret_copy = ClosureReason_commitment_tx_confirmed();
54073 int64_t ret_ref = tag_ptr(ret_copy, true);
54077 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1funding_1timed_1out(JNIEnv *env, jclass clz) {
54078 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
54079 *ret_copy = ClosureReason_funding_timed_out();
54080 int64_t ret_ref = tag_ptr(ret_copy, true);
54084 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1processing_1error(JNIEnv *env, jclass clz, jstring err) {
54085 LDKStr err_conv = java_to_owned_str(env, err);
54086 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
54087 *ret_copy = ClosureReason_processing_error(err_conv);
54088 int64_t ret_ref = tag_ptr(ret_copy, true);
54092 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1disconnected_1peer(JNIEnv *env, jclass clz) {
54093 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
54094 *ret_copy = ClosureReason_disconnected_peer();
54095 int64_t ret_ref = tag_ptr(ret_copy, true);
54099 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1outdated_1channel_1manager(JNIEnv *env, jclass clz) {
54100 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
54101 *ret_copy = ClosureReason_outdated_channel_manager();
54102 int64_t ret_ref = tag_ptr(ret_copy, true);
54106 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosureReason_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
54107 LDKClosureReason* a_conv = (LDKClosureReason*)untag_ptr(a);
54108 LDKClosureReason* b_conv = (LDKClosureReason*)untag_ptr(b);
54109 jboolean ret_conv = ClosureReason_eq(a_conv, b_conv);
54113 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosureReason_1write(JNIEnv *env, jclass clz, int64_t obj) {
54114 LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj);
54115 LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv);
54116 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
54117 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
54118 CVec_u8Z_free(ret_var);
54122 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosureReason_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
54123 LDKu8slice ser_ref;
54124 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
54125 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
54126 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
54127 *ret_conv = ClosureReason_read(ser_ref);
54128 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
54129 return tag_ptr(ret_conv, true);
54132 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
54133 if (!ptr_is_owned(this_ptr)) return;
54134 void* this_ptr_ptr = untag_ptr(this_ptr);
54135 CHECK_ACCESS(this_ptr_ptr);
54136 LDKHTLCDestination this_ptr_conv = *(LDKHTLCDestination*)(this_ptr_ptr);
54137 FREE(untag_ptr(this_ptr));
54138 HTLCDestination_free(this_ptr_conv);
54141 static inline uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg) {
54142 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
54143 *ret_copy = HTLCDestination_clone(arg);
54144 int64_t ret_ref = tag_ptr(ret_copy, true);
54147 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
54148 LDKHTLCDestination* arg_conv = (LDKHTLCDestination*)untag_ptr(arg);
54149 int64_t ret_conv = HTLCDestination_clone_ptr(arg_conv);
54153 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1clone(JNIEnv *env, jclass clz, int64_t orig) {
54154 LDKHTLCDestination* orig_conv = (LDKHTLCDestination*)untag_ptr(orig);
54155 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
54156 *ret_copy = HTLCDestination_clone(orig_conv);
54157 int64_t ret_ref = tag_ptr(ret_copy, true);
54161 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) {
54162 LDKPublicKey node_id_ref;
54163 CHECK((*env)->GetArrayLength(env, node_id) == 33);
54164 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
54165 LDKThirtyTwoBytes channel_id_ref;
54166 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
54167 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data);
54168 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
54169 *ret_copy = HTLCDestination_next_hop_channel(node_id_ref, channel_id_ref);
54170 int64_t ret_ref = tag_ptr(ret_copy, true);
54174 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1unknown_1next_1hop(JNIEnv *env, jclass clz, int64_t requested_forward_scid) {
54175 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
54176 *ret_copy = HTLCDestination_unknown_next_hop(requested_forward_scid);
54177 int64_t ret_ref = tag_ptr(ret_copy, true);
54181 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1invalid_1forward(JNIEnv *env, jclass clz, int64_t requested_forward_scid) {
54182 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
54183 *ret_copy = HTLCDestination_invalid_forward(requested_forward_scid);
54184 int64_t ret_ref = tag_ptr(ret_copy, true);
54188 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1failed_1payment(JNIEnv *env, jclass clz, int8_tArray payment_hash) {
54189 LDKThirtyTwoBytes payment_hash_ref;
54190 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
54191 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
54192 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
54193 *ret_copy = HTLCDestination_failed_payment(payment_hash_ref);
54194 int64_t ret_ref = tag_ptr(ret_copy, true);
54198 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
54199 LDKHTLCDestination* a_conv = (LDKHTLCDestination*)untag_ptr(a);
54200 LDKHTLCDestination* b_conv = (LDKHTLCDestination*)untag_ptr(b);
54201 jboolean ret_conv = HTLCDestination_eq(a_conv, b_conv);
54205 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1write(JNIEnv *env, jclass clz, int64_t obj) {
54206 LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj);
54207 LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv);
54208 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
54209 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
54210 CVec_u8Z_free(ret_var);
54214 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
54215 LDKu8slice ser_ref;
54216 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
54217 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
54218 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
54219 *ret_conv = HTLCDestination_read(ser_ref);
54220 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
54221 return tag_ptr(ret_conv, true);
54224 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1clone(JNIEnv *env, jclass clz, int64_t orig) {
54225 LDKPaymentFailureReason* orig_conv = (LDKPaymentFailureReason*)untag_ptr(orig);
54226 jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_clone(orig_conv));
54230 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1recipient_1rejected(JNIEnv *env, jclass clz) {
54231 jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_recipient_rejected());
54235 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1user_1abandoned(JNIEnv *env, jclass clz) {
54236 jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_user_abandoned());
54240 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1retries_1exhausted(JNIEnv *env, jclass clz) {
54241 jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_retries_exhausted());
54245 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1payment_1expired(JNIEnv *env, jclass clz) {
54246 jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_payment_expired());
54250 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1route_1not_1found(JNIEnv *env, jclass clz) {
54251 jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_route_not_found());
54255 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1unexpected_1error(JNIEnv *env, jclass clz) {
54256 jclass ret_conv = LDKPaymentFailureReason_to_java(env, PaymentFailureReason_unexpected_error());
54260 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
54261 LDKPaymentFailureReason* a_conv = (LDKPaymentFailureReason*)untag_ptr(a);
54262 LDKPaymentFailureReason* b_conv = (LDKPaymentFailureReason*)untag_ptr(b);
54263 jboolean ret_conv = PaymentFailureReason_eq(a_conv, b_conv);
54267 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1write(JNIEnv *env, jclass clz, int64_t obj) {
54268 LDKPaymentFailureReason* obj_conv = (LDKPaymentFailureReason*)untag_ptr(obj);
54269 LDKCVec_u8Z ret_var = PaymentFailureReason_write(obj_conv);
54270 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
54271 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
54272 CVec_u8Z_free(ret_var);
54276 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentFailureReason_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
54277 LDKu8slice ser_ref;
54278 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
54279 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
54280 LDKCResult_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ");
54281 *ret_conv = PaymentFailureReason_read(ser_ref);
54282 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
54283 return tag_ptr(ret_conv, true);
54286 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
54287 if (!ptr_is_owned(this_ptr)) return;
54288 void* this_ptr_ptr = untag_ptr(this_ptr);
54289 CHECK_ACCESS(this_ptr_ptr);
54290 LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr);
54291 FREE(untag_ptr(this_ptr));
54292 Event_free(this_ptr_conv);
54295 static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) {
54296 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54297 *ret_copy = Event_clone(arg);
54298 int64_t ret_ref = tag_ptr(ret_copy, true);
54301 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
54302 LDKEvent* arg_conv = (LDKEvent*)untag_ptr(arg);
54303 int64_t ret_conv = Event_clone_ptr(arg_conv);
54307 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone(JNIEnv *env, jclass clz, int64_t orig) {
54308 LDKEvent* orig_conv = (LDKEvent*)untag_ptr(orig);
54309 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54310 *ret_copy = Event_clone(orig_conv);
54311 int64_t ret_ref = tag_ptr(ret_copy, true);
54315 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) {
54316 LDKThirtyTwoBytes temporary_channel_id_ref;
54317 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
54318 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_ref.data);
54319 LDKPublicKey counterparty_node_id_ref;
54320 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
54321 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
54322 LDKCVec_u8Z output_script_ref;
54323 output_script_ref.datalen = (*env)->GetArrayLength(env, output_script);
54324 output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes");
54325 (*env)->GetByteArrayRegion(env, output_script, 0, output_script_ref.datalen, output_script_ref.data);
54326 LDKU128 user_channel_id_ref;
54327 CHECK((*env)->GetArrayLength(env, user_channel_id) == 16);
54328 (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes);
54329 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54330 *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, counterparty_node_id_ref, channel_value_satoshis, output_script_ref, user_channel_id_ref);
54331 int64_t ret_ref = tag_ptr(ret_copy, true);
54335 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 onion_fields, int64_t amount_msat, int64_t purpose, int8_tArray via_channel_id, int64_t via_user_channel_id, int64_t claim_deadline) {
54336 LDKPublicKey receiver_node_id_ref;
54337 CHECK((*env)->GetArrayLength(env, receiver_node_id) == 33);
54338 (*env)->GetByteArrayRegion(env, receiver_node_id, 0, 33, receiver_node_id_ref.compressed_form);
54339 LDKThirtyTwoBytes payment_hash_ref;
54340 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
54341 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
54342 LDKRecipientOnionFields onion_fields_conv;
54343 onion_fields_conv.inner = untag_ptr(onion_fields);
54344 onion_fields_conv.is_owned = ptr_is_owned(onion_fields);
54345 CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_fields_conv);
54346 onion_fields_conv = RecipientOnionFields_clone(&onion_fields_conv);
54347 void* purpose_ptr = untag_ptr(purpose);
54348 CHECK_ACCESS(purpose_ptr);
54349 LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
54350 purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
54351 LDKThirtyTwoBytes via_channel_id_ref;
54352 CHECK((*env)->GetArrayLength(env, via_channel_id) == 32);
54353 (*env)->GetByteArrayRegion(env, via_channel_id, 0, 32, via_channel_id_ref.data);
54354 void* via_user_channel_id_ptr = untag_ptr(via_user_channel_id);
54355 CHECK_ACCESS(via_user_channel_id_ptr);
54356 LDKCOption_u128Z via_user_channel_id_conv = *(LDKCOption_u128Z*)(via_user_channel_id_ptr);
54357 via_user_channel_id_conv = COption_u128Z_clone((LDKCOption_u128Z*)untag_ptr(via_user_channel_id));
54358 void* claim_deadline_ptr = untag_ptr(claim_deadline);
54359 CHECK_ACCESS(claim_deadline_ptr);
54360 LDKCOption_u32Z claim_deadline_conv = *(LDKCOption_u32Z*)(claim_deadline_ptr);
54361 claim_deadline_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(claim_deadline));
54362 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54363 *ret_copy = Event_payment_claimable(receiver_node_id_ref, payment_hash_ref, onion_fields_conv, amount_msat, purpose_conv, via_channel_id_ref, via_user_channel_id_conv, claim_deadline_conv);
54364 int64_t ret_ref = tag_ptr(ret_copy, true);
54368 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) {
54369 LDKPublicKey receiver_node_id_ref;
54370 CHECK((*env)->GetArrayLength(env, receiver_node_id) == 33);
54371 (*env)->GetByteArrayRegion(env, receiver_node_id, 0, 33, receiver_node_id_ref.compressed_form);
54372 LDKThirtyTwoBytes payment_hash_ref;
54373 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
54374 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
54375 void* purpose_ptr = untag_ptr(purpose);
54376 CHECK_ACCESS(purpose_ptr);
54377 LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
54378 purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
54379 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54380 *ret_copy = Event_payment_claimed(receiver_node_id_ref, payment_hash_ref, amount_msat, purpose_conv);
54381 int64_t ret_ref = tag_ptr(ret_copy, true);
54385 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) {
54386 LDKThirtyTwoBytes payment_id_ref;
54387 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
54388 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
54389 LDKThirtyTwoBytes payment_preimage_ref;
54390 CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
54391 (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
54392 LDKThirtyTwoBytes payment_hash_ref;
54393 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
54394 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
54395 void* fee_paid_msat_ptr = untag_ptr(fee_paid_msat);
54396 CHECK_ACCESS(fee_paid_msat_ptr);
54397 LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr);
54398 fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_paid_msat));
54399 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54400 *ret_copy = Event_payment_sent(payment_id_ref, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv);
54401 int64_t ret_ref = tag_ptr(ret_copy, true);
54405 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed(JNIEnv *env, jclass clz, int8_tArray payment_id, int8_tArray payment_hash, int64_t reason) {
54406 LDKThirtyTwoBytes payment_id_ref;
54407 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
54408 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
54409 LDKThirtyTwoBytes payment_hash_ref;
54410 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
54411 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
54412 void* reason_ptr = untag_ptr(reason);
54413 CHECK_ACCESS(reason_ptr);
54414 LDKCOption_PaymentFailureReasonZ reason_conv = *(LDKCOption_PaymentFailureReasonZ*)(reason_ptr);
54415 reason_conv = COption_PaymentFailureReasonZ_clone((LDKCOption_PaymentFailureReasonZ*)untag_ptr(reason));
54416 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54417 *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref, reason_conv);
54418 int64_t ret_ref = tag_ptr(ret_copy, true);
54422 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_t path) {
54423 LDKThirtyTwoBytes payment_id_ref;
54424 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
54425 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
54426 LDKThirtyTwoBytes payment_hash_ref;
54427 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
54428 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
54430 path_conv.inner = untag_ptr(path);
54431 path_conv.is_owned = ptr_is_owned(path);
54432 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv);
54433 path_conv = Path_clone(&path_conv);
54434 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54435 *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_conv);
54436 int64_t ret_ref = tag_ptr(ret_copy, true);
54440 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_t path, int64_t short_channel_id) {
54441 LDKThirtyTwoBytes payment_id_ref;
54442 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
54443 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
54444 LDKThirtyTwoBytes payment_hash_ref;
54445 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
54446 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
54447 void* failure_ptr = untag_ptr(failure);
54448 CHECK_ACCESS(failure_ptr);
54449 LDKPathFailure failure_conv = *(LDKPathFailure*)(failure_ptr);
54450 failure_conv = PathFailure_clone((LDKPathFailure*)untag_ptr(failure));
54452 path_conv.inner = untag_ptr(path);
54453 path_conv.is_owned = ptr_is_owned(path);
54454 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv);
54455 path_conv = Path_clone(&path_conv);
54456 void* short_channel_id_ptr = untag_ptr(short_channel_id);
54457 CHECK_ACCESS(short_channel_id_ptr);
54458 LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
54459 short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id));
54460 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54461 *ret_copy = Event_payment_path_failed(payment_id_ref, payment_hash_ref, payment_failed_permanently, failure_conv, path_conv, short_channel_id_conv);
54462 int64_t ret_ref = tag_ptr(ret_copy, true);
54466 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_t path) {
54467 LDKThirtyTwoBytes payment_id_ref;
54468 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
54469 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
54470 LDKThirtyTwoBytes payment_hash_ref;
54471 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
54472 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
54474 path_conv.inner = untag_ptr(path);
54475 path_conv.is_owned = ptr_is_owned(path);
54476 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv);
54477 path_conv = Path_clone(&path_conv);
54478 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54479 *ret_copy = Event_probe_successful(payment_id_ref, payment_hash_ref, path_conv);
54480 int64_t ret_ref = tag_ptr(ret_copy, true);
54484 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_t path, int64_t short_channel_id) {
54485 LDKThirtyTwoBytes payment_id_ref;
54486 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
54487 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
54488 LDKThirtyTwoBytes payment_hash_ref;
54489 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
54490 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
54492 path_conv.inner = untag_ptr(path);
54493 path_conv.is_owned = ptr_is_owned(path);
54494 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv);
54495 path_conv = Path_clone(&path_conv);
54496 void* short_channel_id_ptr = untag_ptr(short_channel_id);
54497 CHECK_ACCESS(short_channel_id_ptr);
54498 LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
54499 short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id));
54500 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54501 *ret_copy = Event_probe_failed(payment_id_ref, payment_hash_ref, path_conv, short_channel_id_conv);
54502 int64_t ret_ref = tag_ptr(ret_copy, true);
54506 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forwardable(JNIEnv *env, jclass clz, int64_t time_forwardable) {
54507 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54508 *ret_copy = Event_pending_htlcs_forwardable(time_forwardable);
54509 int64_t ret_ref = tag_ptr(ret_copy, true);
54513 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) {
54514 LDKThirtyTwoBytes intercept_id_ref;
54515 CHECK((*env)->GetArrayLength(env, intercept_id) == 32);
54516 (*env)->GetByteArrayRegion(env, intercept_id, 0, 32, intercept_id_ref.data);
54517 LDKThirtyTwoBytes payment_hash_ref;
54518 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
54519 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
54520 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54521 *ret_copy = Event_htlcintercepted(intercept_id_ref, requested_next_hop_scid, payment_hash_ref, inbound_amount_msat, expected_outbound_amount_msat);
54522 int64_t ret_ref = tag_ptr(ret_copy, true);
54526 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs(JNIEnv *env, jclass clz, int64_tArray outputs) {
54527 LDKCVec_SpendableOutputDescriptorZ outputs_constr;
54528 outputs_constr.datalen = (*env)->GetArrayLength(env, outputs);
54529 if (outputs_constr.datalen > 0)
54530 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
54532 outputs_constr.data = NULL;
54533 int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL);
54534 for (size_t b = 0; b < outputs_constr.datalen; b++) {
54535 int64_t outputs_conv_27 = outputs_vals[b];
54536 void* outputs_conv_27_ptr = untag_ptr(outputs_conv_27);
54537 CHECK_ACCESS(outputs_conv_27_ptr);
54538 LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr);
54539 outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(outputs_conv_27));
54540 outputs_constr.data[b] = outputs_conv_27_conv;
54542 (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0);
54543 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54544 *ret_copy = Event_spendable_outputs(outputs_constr);
54545 int64_t ret_ref = tag_ptr(ret_copy, true);
54549 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, int64_t outbound_amount_forwarded_msat) {
54550 LDKThirtyTwoBytes prev_channel_id_ref;
54551 CHECK((*env)->GetArrayLength(env, prev_channel_id) == 32);
54552 (*env)->GetByteArrayRegion(env, prev_channel_id, 0, 32, prev_channel_id_ref.data);
54553 LDKThirtyTwoBytes next_channel_id_ref;
54554 CHECK((*env)->GetArrayLength(env, next_channel_id) == 32);
54555 (*env)->GetByteArrayRegion(env, next_channel_id, 0, 32, next_channel_id_ref.data);
54556 void* fee_earned_msat_ptr = untag_ptr(fee_earned_msat);
54557 CHECK_ACCESS(fee_earned_msat_ptr);
54558 LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr);
54559 fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_earned_msat));
54560 void* outbound_amount_forwarded_msat_ptr = untag_ptr(outbound_amount_forwarded_msat);
54561 CHECK_ACCESS(outbound_amount_forwarded_msat_ptr);
54562 LDKCOption_u64Z outbound_amount_forwarded_msat_conv = *(LDKCOption_u64Z*)(outbound_amount_forwarded_msat_ptr);
54563 outbound_amount_forwarded_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_amount_forwarded_msat));
54564 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54565 *ret_copy = Event_payment_forwarded(prev_channel_id_ref, next_channel_id_ref, fee_earned_msat_conv, claim_from_onchain_tx, outbound_amount_forwarded_msat_conv);
54566 int64_t ret_ref = tag_ptr(ret_copy, true);
54570 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1pending(JNIEnv *env, jclass clz, int8_tArray channel_id, int8_tArray user_channel_id, int8_tArray former_temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_txo) {
54571 LDKThirtyTwoBytes channel_id_ref;
54572 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
54573 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data);
54574 LDKU128 user_channel_id_ref;
54575 CHECK((*env)->GetArrayLength(env, user_channel_id) == 16);
54576 (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes);
54577 LDKThirtyTwoBytes former_temporary_channel_id_ref;
54578 CHECK((*env)->GetArrayLength(env, former_temporary_channel_id) == 32);
54579 (*env)->GetByteArrayRegion(env, former_temporary_channel_id, 0, 32, former_temporary_channel_id_ref.data);
54580 LDKPublicKey counterparty_node_id_ref;
54581 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
54582 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
54583 LDKOutPoint funding_txo_conv;
54584 funding_txo_conv.inner = untag_ptr(funding_txo);
54585 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
54586 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
54587 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
54588 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54589 *ret_copy = Event_channel_pending(channel_id_ref, user_channel_id_ref, former_temporary_channel_id_ref, counterparty_node_id_ref, funding_txo_conv);
54590 int64_t ret_ref = tag_ptr(ret_copy, true);
54594 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) {
54595 LDKThirtyTwoBytes channel_id_ref;
54596 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
54597 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data);
54598 LDKU128 user_channel_id_ref;
54599 CHECK((*env)->GetArrayLength(env, user_channel_id) == 16);
54600 (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes);
54601 LDKPublicKey counterparty_node_id_ref;
54602 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
54603 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
54604 LDKChannelTypeFeatures channel_type_conv;
54605 channel_type_conv.inner = untag_ptr(channel_type);
54606 channel_type_conv.is_owned = ptr_is_owned(channel_type);
54607 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv);
54608 channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv);
54609 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54610 *ret_copy = Event_channel_ready(channel_id_ref, user_channel_id_ref, counterparty_node_id_ref, channel_type_conv);
54611 int64_t ret_ref = tag_ptr(ret_copy, true);
54615 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) {
54616 LDKThirtyTwoBytes channel_id_ref;
54617 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
54618 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data);
54619 LDKU128 user_channel_id_ref;
54620 CHECK((*env)->GetArrayLength(env, user_channel_id) == 16);
54621 (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes);
54622 void* reason_ptr = untag_ptr(reason);
54623 CHECK_ACCESS(reason_ptr);
54624 LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr);
54625 reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason));
54626 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54627 *ret_copy = Event_channel_closed(channel_id_ref, user_channel_id_ref, reason_conv);
54628 int64_t ret_ref = tag_ptr(ret_copy, true);
54632 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1discard_1funding(JNIEnv *env, jclass clz, int8_tArray channel_id, int8_tArray transaction) {
54633 LDKThirtyTwoBytes channel_id_ref;
54634 CHECK((*env)->GetArrayLength(env, channel_id) == 32);
54635 (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data);
54636 LDKTransaction transaction_ref;
54637 transaction_ref.datalen = (*env)->GetArrayLength(env, transaction);
54638 transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes");
54639 (*env)->GetByteArrayRegion(env, transaction, 0, transaction_ref.datalen, transaction_ref.data);
54640 transaction_ref.data_is_owned = true;
54641 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54642 *ret_copy = Event_discard_funding(channel_id_ref, transaction_ref);
54643 int64_t ret_ref = tag_ptr(ret_copy, true);
54647 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) {
54648 LDKThirtyTwoBytes temporary_channel_id_ref;
54649 CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
54650 (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_ref.data);
54651 LDKPublicKey counterparty_node_id_ref;
54652 CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33);
54653 (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form);
54654 LDKChannelTypeFeatures channel_type_conv;
54655 channel_type_conv.inner = untag_ptr(channel_type);
54656 channel_type_conv.is_owned = ptr_is_owned(channel_type);
54657 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv);
54658 channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv);
54659 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54660 *ret_copy = Event_open_channel_request(temporary_channel_id_ref, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv);
54661 int64_t ret_ref = tag_ptr(ret_copy, true);
54665 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) {
54666 LDKThirtyTwoBytes prev_channel_id_ref;
54667 CHECK((*env)->GetArrayLength(env, prev_channel_id) == 32);
54668 (*env)->GetByteArrayRegion(env, prev_channel_id, 0, 32, prev_channel_id_ref.data);
54669 void* failed_next_destination_ptr = untag_ptr(failed_next_destination);
54670 CHECK_ACCESS(failed_next_destination_ptr);
54671 LDKHTLCDestination failed_next_destination_conv = *(LDKHTLCDestination*)(failed_next_destination_ptr);
54672 failed_next_destination_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(failed_next_destination));
54673 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
54674 *ret_copy = Event_htlchandling_failed(prev_channel_id_ref, failed_next_destination_conv);
54675 int64_t ret_ref = tag_ptr(ret_copy, true);
54679 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Event_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
54680 LDKEvent* a_conv = (LDKEvent*)untag_ptr(a);
54681 LDKEvent* b_conv = (LDKEvent*)untag_ptr(b);
54682 jboolean ret_conv = Event_eq(a_conv, b_conv);
54686 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Event_1write(JNIEnv *env, jclass clz, int64_t obj) {
54687 LDKEvent* obj_conv = (LDKEvent*)untag_ptr(obj);
54688 LDKCVec_u8Z ret_var = Event_write(obj_conv);
54689 int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
54690 (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
54691 CVec_u8Z_free(ret_var);
54695 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1read(JNIEnv *env, jclass clz, int8_tArray ser) {
54696 LDKu8slice ser_ref;
54697 ser_ref.datalen = (*env)->GetArrayLength(env, ser);
54698 ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL);
54699 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
54700 *ret_conv = Event_read(ser_ref);
54701 (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0);
54702 return tag_ptr(ret_conv, true);
54705 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
54706 if (!ptr_is_owned(this_ptr)) return;
54707 void* this_ptr_ptr = untag_ptr(this_ptr);
54708 CHECK_ACCESS(this_ptr_ptr);
54709 LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr);
54710 FREE(untag_ptr(this_ptr));
54711 MessageSendEvent_free(this_ptr_conv);
54714 static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) {
54715 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54716 *ret_copy = MessageSendEvent_clone(arg);
54717 int64_t ret_ref = tag_ptr(ret_copy, true);
54720 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
54721 LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)untag_ptr(arg);
54722 int64_t ret_conv = MessageSendEvent_clone_ptr(arg_conv);
54726 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone(JNIEnv *env, jclass clz, int64_t orig) {
54727 LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)untag_ptr(orig);
54728 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54729 *ret_copy = MessageSendEvent_clone(orig_conv);
54730 int64_t ret_ref = tag_ptr(ret_copy, true);
54734 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1accept_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
54735 LDKPublicKey node_id_ref;
54736 CHECK((*env)->GetArrayLength(env, node_id) == 33);
54737 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
54738 LDKAcceptChannel msg_conv;
54739 msg_conv.inner = untag_ptr(msg);
54740 msg_conv.is_owned = ptr_is_owned(msg);
54741 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
54742 msg_conv = AcceptChannel_clone(&msg_conv);
54743 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54744 *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv);
54745 int64_t ret_ref = tag_ptr(ret_copy, true);
54749 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1open_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
54750 LDKPublicKey node_id_ref;
54751 CHECK((*env)->GetArrayLength(env, node_id) == 33);
54752 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
54753 LDKOpenChannel msg_conv;
54754 msg_conv.inner = untag_ptr(msg);
54755 msg_conv.is_owned = ptr_is_owned(msg);
54756 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
54757 msg_conv = OpenChannel_clone(&msg_conv);
54758 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54759 *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv);
54760 int64_t ret_ref = tag_ptr(ret_copy, true);
54764 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1created(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
54765 LDKPublicKey node_id_ref;
54766 CHECK((*env)->GetArrayLength(env, node_id) == 33);
54767 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
54768 LDKFundingCreated msg_conv;
54769 msg_conv.inner = untag_ptr(msg);
54770 msg_conv.is_owned = ptr_is_owned(msg);
54771 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
54772 msg_conv = FundingCreated_clone(&msg_conv);
54773 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54774 *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv);
54775 int64_t ret_ref = tag_ptr(ret_copy, true);
54779 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
54780 LDKPublicKey node_id_ref;
54781 CHECK((*env)->GetArrayLength(env, node_id) == 33);
54782 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
54783 LDKFundingSigned msg_conv;
54784 msg_conv.inner = untag_ptr(msg);
54785 msg_conv.is_owned = ptr_is_owned(msg);
54786 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
54787 msg_conv = FundingSigned_clone(&msg_conv);
54788 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54789 *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv);
54790 int64_t ret_ref = tag_ptr(ret_copy, true);
54794 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1ready(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
54795 LDKPublicKey node_id_ref;
54796 CHECK((*env)->GetArrayLength(env, node_id) == 33);
54797 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
54798 LDKChannelReady msg_conv;
54799 msg_conv.inner = untag_ptr(msg);
54800 msg_conv.is_owned = ptr_is_owned(msg);
54801 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
54802 msg_conv = ChannelReady_clone(&msg_conv);
54803 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54804 *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv);
54805 int64_t ret_ref = tag_ptr(ret_copy, true);
54809 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1announcement_1signatures(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
54810 LDKPublicKey node_id_ref;
54811 CHECK((*env)->GetArrayLength(env, node_id) == 33);
54812 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
54813 LDKAnnouncementSignatures msg_conv;
54814 msg_conv.inner = untag_ptr(msg);
54815 msg_conv.is_owned = ptr_is_owned(msg);
54816 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
54817 msg_conv = AnnouncementSignatures_clone(&msg_conv);
54818 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54819 *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv);
54820 int64_t ret_ref = tag_ptr(ret_copy, true);
54824 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1update_1htlcs(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t updates) {
54825 LDKPublicKey node_id_ref;
54826 CHECK((*env)->GetArrayLength(env, node_id) == 33);
54827 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
54828 LDKCommitmentUpdate updates_conv;
54829 updates_conv.inner = untag_ptr(updates);
54830 updates_conv.is_owned = ptr_is_owned(updates);
54831 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
54832 updates_conv = CommitmentUpdate_clone(&updates_conv);
54833 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54834 *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv);
54835 int64_t ret_ref = tag_ptr(ret_copy, true);
54839 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) {
54840 LDKPublicKey node_id_ref;
54841 CHECK((*env)->GetArrayLength(env, node_id) == 33);
54842 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
54843 LDKRevokeAndACK msg_conv;
54844 msg_conv.inner = untag_ptr(msg);
54845 msg_conv.is_owned = ptr_is_owned(msg);
54846 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
54847 msg_conv = RevokeAndACK_clone(&msg_conv);
54848 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54849 *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv);
54850 int64_t ret_ref = tag_ptr(ret_copy, true);
54854 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1closing_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
54855 LDKPublicKey node_id_ref;
54856 CHECK((*env)->GetArrayLength(env, node_id) == 33);
54857 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
54858 LDKClosingSigned msg_conv;
54859 msg_conv.inner = untag_ptr(msg);
54860 msg_conv.is_owned = ptr_is_owned(msg);
54861 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
54862 msg_conv = ClosingSigned_clone(&msg_conv);
54863 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54864 *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv);
54865 int64_t ret_ref = tag_ptr(ret_copy, true);
54869 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1shutdown(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
54870 LDKPublicKey node_id_ref;
54871 CHECK((*env)->GetArrayLength(env, node_id) == 33);
54872 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
54873 LDKShutdown msg_conv;
54874 msg_conv.inner = untag_ptr(msg);
54875 msg_conv.is_owned = ptr_is_owned(msg);
54876 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
54877 msg_conv = Shutdown_clone(&msg_conv);
54878 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54879 *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv);
54880 int64_t ret_ref = tag_ptr(ret_copy, true);
54884 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1reestablish(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
54885 LDKPublicKey node_id_ref;
54886 CHECK((*env)->GetArrayLength(env, node_id) == 33);
54887 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
54888 LDKChannelReestablish msg_conv;
54889 msg_conv.inner = untag_ptr(msg);
54890 msg_conv.is_owned = ptr_is_owned(msg);
54891 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
54892 msg_conv = ChannelReestablish_clone(&msg_conv);
54893 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54894 *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv);
54895 int64_t ret_ref = tag_ptr(ret_copy, true);
54899 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) {
54900 LDKPublicKey node_id_ref;
54901 CHECK((*env)->GetArrayLength(env, node_id) == 33);
54902 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
54903 LDKChannelAnnouncement msg_conv;
54904 msg_conv.inner = untag_ptr(msg);
54905 msg_conv.is_owned = ptr_is_owned(msg);
54906 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
54907 msg_conv = ChannelAnnouncement_clone(&msg_conv);
54908 LDKChannelUpdate update_msg_conv;
54909 update_msg_conv.inner = untag_ptr(update_msg);
54910 update_msg_conv.is_owned = ptr_is_owned(update_msg);
54911 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv);
54912 update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
54913 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54914 *ret_copy = MessageSendEvent_send_channel_announcement(node_id_ref, msg_conv, update_msg_conv);
54915 int64_t ret_ref = tag_ptr(ret_copy, true);
54919 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1announcement(JNIEnv *env, jclass clz, int64_t msg, int64_t update_msg) {
54920 LDKChannelAnnouncement msg_conv;
54921 msg_conv.inner = untag_ptr(msg);
54922 msg_conv.is_owned = ptr_is_owned(msg);
54923 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
54924 msg_conv = ChannelAnnouncement_clone(&msg_conv);
54925 LDKChannelUpdate update_msg_conv;
54926 update_msg_conv.inner = untag_ptr(update_msg);
54927 update_msg_conv.is_owned = ptr_is_owned(update_msg);
54928 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv);
54929 update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
54930 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54931 *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv);
54932 int64_t ret_ref = tag_ptr(ret_copy, true);
54936 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1update(JNIEnv *env, jclass clz, int64_t msg) {
54937 LDKChannelUpdate msg_conv;
54938 msg_conv.inner = untag_ptr(msg);
54939 msg_conv.is_owned = ptr_is_owned(msg);
54940 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
54941 msg_conv = ChannelUpdate_clone(&msg_conv);
54942 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54943 *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv);
54944 int64_t ret_ref = tag_ptr(ret_copy, true);
54948 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1node_1announcement(JNIEnv *env, jclass clz, int64_t msg) {
54949 LDKNodeAnnouncement msg_conv;
54950 msg_conv.inner = untag_ptr(msg);
54951 msg_conv.is_owned = ptr_is_owned(msg);
54952 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
54953 msg_conv = NodeAnnouncement_clone(&msg_conv);
54954 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54955 *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv);
54956 int64_t ret_ref = tag_ptr(ret_copy, true);
54960 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1update(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
54961 LDKPublicKey node_id_ref;
54962 CHECK((*env)->GetArrayLength(env, node_id) == 33);
54963 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
54964 LDKChannelUpdate msg_conv;
54965 msg_conv.inner = untag_ptr(msg);
54966 msg_conv.is_owned = ptr_is_owned(msg);
54967 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
54968 msg_conv = ChannelUpdate_clone(&msg_conv);
54969 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54970 *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv);
54971 int64_t ret_ref = tag_ptr(ret_copy, true);
54975 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1handle_1error(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t action) {
54976 LDKPublicKey node_id_ref;
54977 CHECK((*env)->GetArrayLength(env, node_id) == 33);
54978 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
54979 void* action_ptr = untag_ptr(action);
54980 CHECK_ACCESS(action_ptr);
54981 LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr);
54982 action_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action));
54983 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54984 *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv);
54985 int64_t ret_ref = tag_ptr(ret_copy, true);
54989 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) {
54990 LDKPublicKey node_id_ref;
54991 CHECK((*env)->GetArrayLength(env, node_id) == 33);
54992 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
54993 LDKQueryChannelRange msg_conv;
54994 msg_conv.inner = untag_ptr(msg);
54995 msg_conv.is_owned = ptr_is_owned(msg);
54996 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
54997 msg_conv = QueryChannelRange_clone(&msg_conv);
54998 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
54999 *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv);
55000 int64_t ret_ref = tag_ptr(ret_copy, true);
55004 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) {
55005 LDKPublicKey node_id_ref;
55006 CHECK((*env)->GetArrayLength(env, node_id) == 33);
55007 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
55008 LDKQueryShortChannelIds msg_conv;
55009 msg_conv.inner = untag_ptr(msg);
55010 msg_conv.is_owned = ptr_is_owned(msg);
55011 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
55012 msg_conv = QueryShortChannelIds_clone(&msg_conv);
55013 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
55014 *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv);
55015 int64_t ret_ref = tag_ptr(ret_copy, true);
55019 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) {
55020 LDKPublicKey node_id_ref;
55021 CHECK((*env)->GetArrayLength(env, node_id) == 33);
55022 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
55023 LDKReplyChannelRange msg_conv;
55024 msg_conv.inner = untag_ptr(msg);
55025 msg_conv.is_owned = ptr_is_owned(msg);
55026 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
55027 msg_conv = ReplyChannelRange_clone(&msg_conv);
55028 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
55029 *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv);
55030 int64_t ret_ref = tag_ptr(ret_copy, true);
55034 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) {
55035 LDKPublicKey node_id_ref;
55036 CHECK((*env)->GetArrayLength(env, node_id) == 33);
55037 (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
55038 LDKGossipTimestampFilter msg_conv;
55039 msg_conv.inner = untag_ptr(msg);
55040 msg_conv.is_owned = ptr_is_owned(msg);
55041 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
55042 msg_conv = GossipTimestampFilter_clone(&msg_conv);
55043 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
55044 *ret_copy = MessageSendEvent_send_gossip_timestamp_filter(node_id_ref, msg_conv);
55045 int64_t ret_ref = tag_ptr(ret_copy, true);
55049 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
55050 if (!ptr_is_owned(this_ptr)) return;
55051 void* this_ptr_ptr = untag_ptr(this_ptr);
55052 CHECK_ACCESS(this_ptr_ptr);
55053 LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr);
55054 FREE(untag_ptr(this_ptr));
55055 MessageSendEventsProvider_free(this_ptr_conv);
55058 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
55059 if (!ptr_is_owned(this_ptr)) return;
55060 void* this_ptr_ptr = untag_ptr(this_ptr);
55061 CHECK_ACCESS(this_ptr_ptr);
55062 LDKOnionMessageProvider this_ptr_conv = *(LDKOnionMessageProvider*)(this_ptr_ptr);
55063 FREE(untag_ptr(this_ptr));
55064 OnionMessageProvider_free(this_ptr_conv);
55067 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
55068 if (!ptr_is_owned(this_ptr)) return;
55069 void* this_ptr_ptr = untag_ptr(this_ptr);
55070 CHECK_ACCESS(this_ptr_ptr);
55071 LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr);
55072 FREE(untag_ptr(this_ptr));
55073 EventsProvider_free(this_ptr_conv);
55076 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
55077 if (!ptr_is_owned(this_ptr)) return;
55078 void* this_ptr_ptr = untag_ptr(this_ptr);
55079 CHECK_ACCESS(this_ptr_ptr);
55080 LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr);
55081 FREE(untag_ptr(this_ptr));
55082 EventHandler_free(this_ptr_conv);
55085 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
55086 LDKFilesystemPersister this_obj_conv;
55087 this_obj_conv.inner = untag_ptr(this_obj);
55088 this_obj_conv.is_owned = ptr_is_owned(this_obj);
55089 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
55090 FilesystemPersister_free(this_obj_conv);
55093 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1new(JNIEnv *env, jclass clz, jstring path_to_channel_data) {
55094 LDKStr path_to_channel_data_conv = java_to_owned_str(env, path_to_channel_data);
55095 LDKFilesystemPersister ret_var = FilesystemPersister_new(path_to_channel_data_conv);
55096 int64_t ret_ref = 0;
55097 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
55098 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
55102 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1get_1data_1dir(JNIEnv *env, jclass clz, int64_t this_arg) {
55103 LDKFilesystemPersister this_arg_conv;
55104 this_arg_conv.inner = untag_ptr(this_arg);
55105 this_arg_conv.is_owned = ptr_is_owned(this_arg);
55106 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
55107 this_arg_conv.is_owned = false;
55108 LDKStr ret_str = FilesystemPersister_get_data_dir(&this_arg_conv);
55109 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
55114 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) {
55115 LDKFilesystemPersister this_arg_conv;
55116 this_arg_conv.inner = untag_ptr(this_arg);
55117 this_arg_conv.is_owned = ptr_is_owned(this_arg);
55118 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
55119 this_arg_conv.is_owned = false;
55120 void* entropy_source_ptr = untag_ptr(entropy_source);
55121 CHECK_ACCESS(entropy_source_ptr);
55122 LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr);
55123 if (entropy_source_conv.free == LDKEntropySource_JCalls_free) {
55124 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
55125 LDKEntropySource_JCalls_cloned(&entropy_source_conv);
55127 void* signer_provider_ptr = untag_ptr(signer_provider);
55128 if (ptr_is_owned(signer_provider)) { CHECK_ACCESS(signer_provider_ptr); }
55129 LDKSignerProvider* signer_provider_conv = (LDKSignerProvider*)signer_provider_ptr;
55130 LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
55131 *ret_conv = FilesystemPersister_read_channelmonitors(&this_arg_conv, entropy_source_conv, signer_provider_conv);
55132 return tag_ptr(ret_conv, true);
55135 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
55136 LDKBackgroundProcessor this_obj_conv;
55137 this_obj_conv.inner = untag_ptr(this_obj);
55138 this_obj_conv.is_owned = ptr_is_owned(this_obj);
55139 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
55140 BackgroundProcessor_free(this_obj_conv);
55143 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipSync_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
55144 if (!ptr_is_owned(this_ptr)) return;
55145 void* this_ptr_ptr = untag_ptr(this_ptr);
55146 CHECK_ACCESS(this_ptr_ptr);
55147 LDKGossipSync this_ptr_conv = *(LDKGossipSync*)(this_ptr_ptr);
55148 FREE(untag_ptr(this_ptr));
55149 GossipSync_free(this_ptr_conv);
55152 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1p2_1p(JNIEnv *env, jclass clz, int64_t a) {
55153 LDKP2PGossipSync a_conv;
55154 a_conv.inner = untag_ptr(a);
55155 a_conv.is_owned = ptr_is_owned(a);
55156 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
55157 a_conv.is_owned = false;
55158 LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync");
55159 *ret_copy = GossipSync_p2_p(&a_conv);
55160 int64_t ret_ref = tag_ptr(ret_copy, true);
55164 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1rapid(JNIEnv *env, jclass clz, int64_t a) {
55165 LDKRapidGossipSync a_conv;
55166 a_conv.inner = untag_ptr(a);
55167 a_conv.is_owned = ptr_is_owned(a);
55168 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
55169 a_conv.is_owned = false;
55170 LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync");
55171 *ret_copy = GossipSync_rapid(&a_conv);
55172 int64_t ret_ref = tag_ptr(ret_copy, true);
55176 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GossipSync_1none(JNIEnv *env, jclass clz) {
55177 LDKGossipSync *ret_copy = MALLOC(sizeof(LDKGossipSync), "LDKGossipSync");
55178 *ret_copy = GossipSync_none();
55179 int64_t ret_ref = tag_ptr(ret_copy, true);
55183 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) {
55184 void* persister_ptr = untag_ptr(persister);
55185 CHECK_ACCESS(persister_ptr);
55186 LDKPersister persister_conv = *(LDKPersister*)(persister_ptr);
55187 if (persister_conv.free == LDKPersister_JCalls_free) {
55188 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
55189 LDKPersister_JCalls_cloned(&persister_conv);
55191 void* event_handler_ptr = untag_ptr(event_handler);
55192 CHECK_ACCESS(event_handler_ptr);
55193 LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
55194 if (event_handler_conv.free == LDKEventHandler_JCalls_free) {
55195 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
55196 LDKEventHandler_JCalls_cloned(&event_handler_conv);
55198 LDKChainMonitor chain_monitor_conv;
55199 chain_monitor_conv.inner = untag_ptr(chain_monitor);
55200 chain_monitor_conv.is_owned = ptr_is_owned(chain_monitor);
55201 CHECK_INNER_FIELD_ACCESS_OR_NULL(chain_monitor_conv);
55202 chain_monitor_conv.is_owned = false;
55203 LDKChannelManager channel_manager_conv;
55204 channel_manager_conv.inner = untag_ptr(channel_manager);
55205 channel_manager_conv.is_owned = ptr_is_owned(channel_manager);
55206 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv);
55207 channel_manager_conv.is_owned = false;
55208 void* gossip_sync_ptr = untag_ptr(gossip_sync);
55209 CHECK_ACCESS(gossip_sync_ptr);
55210 LDKGossipSync gossip_sync_conv = *(LDKGossipSync*)(gossip_sync_ptr);
55211 // WARNING: we may need a move here but no clone is available for LDKGossipSync
55212 LDKPeerManager peer_manager_conv;
55213 peer_manager_conv.inner = untag_ptr(peer_manager);
55214 peer_manager_conv.is_owned = ptr_is_owned(peer_manager);
55215 CHECK_INNER_FIELD_ACCESS_OR_NULL(peer_manager_conv);
55216 peer_manager_conv.is_owned = false;
55217 void* logger_ptr = untag_ptr(logger);
55218 CHECK_ACCESS(logger_ptr);
55219 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
55220 if (logger_conv.free == LDKLogger_JCalls_free) {
55221 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
55222 LDKLogger_JCalls_cloned(&logger_conv);
55224 void* scorer_ptr = untag_ptr(scorer);
55225 CHECK_ACCESS(scorer_ptr);
55226 LDKCOption_WriteableScoreZ scorer_conv = *(LDKCOption_WriteableScoreZ*)(scorer_ptr);
55227 // WARNING: we may need a move here but no clone is available for LDKCOption_WriteableScoreZ
55228 if (scorer_conv.tag == LDKCOption_WriteableScoreZ_Some) {
55229 // Manually implement clone for Java trait instances
55230 if (scorer_conv.some.free == LDKWriteableScore_JCalls_free) {
55231 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
55232 LDKWriteableScore_JCalls_cloned(&scorer_conv.some);
55235 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);
55236 int64_t ret_ref = 0;
55237 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
55238 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
55242 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1join(JNIEnv *env, jclass clz, int64_t this_arg) {
55243 LDKBackgroundProcessor this_arg_conv;
55244 this_arg_conv.inner = untag_ptr(this_arg);
55245 this_arg_conv.is_owned = ptr_is_owned(this_arg);
55246 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
55247 // WARNING: we need a move here but no clone is available for LDKBackgroundProcessor
55249 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
55250 *ret_conv = BackgroundProcessor_join(this_arg_conv);
55251 return tag_ptr(ret_conv, true);
55254 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1stop(JNIEnv *env, jclass clz, int64_t this_arg) {
55255 LDKBackgroundProcessor this_arg_conv;
55256 this_arg_conv.inner = untag_ptr(this_arg);
55257 this_arg_conv.is_owned = ptr_is_owned(this_arg);
55258 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
55259 // WARNING: we need a move here but no clone is available for LDKBackgroundProcessor
55261 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
55262 *ret_conv = BackgroundProcessor_stop(this_arg_conv);
55263 return tag_ptr(ret_conv, true);
55266 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ParseError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
55267 if (!ptr_is_owned(this_ptr)) return;
55268 void* this_ptr_ptr = untag_ptr(this_ptr);
55269 CHECK_ACCESS(this_ptr_ptr);
55270 LDKParseError this_ptr_conv = *(LDKParseError*)(this_ptr_ptr);
55271 FREE(untag_ptr(this_ptr));
55272 ParseError_free(this_ptr_conv);
55275 static inline uint64_t ParseError_clone_ptr(LDKParseError *NONNULL_PTR arg) {
55276 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55277 *ret_copy = ParseError_clone(arg);
55278 int64_t ret_ref = tag_ptr(ret_copy, true);
55281 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
55282 LDKParseError* arg_conv = (LDKParseError*)untag_ptr(arg);
55283 int64_t ret_conv = ParseError_clone_ptr(arg_conv);
55287 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
55288 LDKParseError* orig_conv = (LDKParseError*)untag_ptr(orig);
55289 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55290 *ret_copy = ParseError_clone(orig_conv);
55291 int64_t ret_ref = tag_ptr(ret_copy, true);
55295 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1bech32_1error(JNIEnv *env, jclass clz, int64_t a) {
55296 void* a_ptr = untag_ptr(a);
55297 CHECK_ACCESS(a_ptr);
55298 LDKBech32Error a_conv = *(LDKBech32Error*)(a_ptr);
55299 a_conv = Bech32Error_clone((LDKBech32Error*)untag_ptr(a));
55300 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55301 *ret_copy = ParseError_bech32_error(a_conv);
55302 int64_t ret_ref = tag_ptr(ret_copy, true);
55306 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1parse_1amount_1error(JNIEnv *env, jclass clz, int32_t a) {
55308 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55309 *ret_copy = ParseError_parse_amount_error((LDKError){ ._dummy = 0 });
55310 int64_t ret_ref = tag_ptr(ret_copy, true);
55314 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1malformed_1signature(JNIEnv *env, jclass clz, jclass a) {
55315 LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_java(env, a);
55316 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55317 *ret_copy = ParseError_malformed_signature(a_conv);
55318 int64_t ret_ref = tag_ptr(ret_copy, true);
55322 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1bad_1prefix(JNIEnv *env, jclass clz) {
55323 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55324 *ret_copy = ParseError_bad_prefix();
55325 int64_t ret_ref = tag_ptr(ret_copy, true);
55329 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1unknown_1currency(JNIEnv *env, jclass clz) {
55330 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55331 *ret_copy = ParseError_unknown_currency();
55332 int64_t ret_ref = tag_ptr(ret_copy, true);
55336 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1unknown_1si_1prefix(JNIEnv *env, jclass clz) {
55337 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55338 *ret_copy = ParseError_unknown_si_prefix();
55339 int64_t ret_ref = tag_ptr(ret_copy, true);
55343 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1malformed_1hrp(JNIEnv *env, jclass clz) {
55344 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55345 *ret_copy = ParseError_malformed_hrp();
55346 int64_t ret_ref = tag_ptr(ret_copy, true);
55350 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1too_1short_1data_1part(JNIEnv *env, jclass clz) {
55351 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55352 *ret_copy = ParseError_too_short_data_part();
55353 int64_t ret_ref = tag_ptr(ret_copy, true);
55357 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1unexpected_1end_1of_1tagged_1fields(JNIEnv *env, jclass clz) {
55358 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55359 *ret_copy = ParseError_unexpected_end_of_tagged_fields();
55360 int64_t ret_ref = tag_ptr(ret_copy, true);
55364 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1description_1decode_1error(JNIEnv *env, jclass clz, int32_t a) {
55366 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55367 *ret_copy = ParseError_description_decode_error((LDKError){ ._dummy = 0 });
55368 int64_t ret_ref = tag_ptr(ret_copy, true);
55372 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1padding_1error(JNIEnv *env, jclass clz) {
55373 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55374 *ret_copy = ParseError_padding_error();
55375 int64_t ret_ref = tag_ptr(ret_copy, true);
55379 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1integer_1overflow_1error(JNIEnv *env, jclass clz) {
55380 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55381 *ret_copy = ParseError_integer_overflow_error();
55382 int64_t ret_ref = tag_ptr(ret_copy, true);
55386 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1seg_1wit_1program_1length(JNIEnv *env, jclass clz) {
55387 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55388 *ret_copy = ParseError_invalid_seg_wit_program_length();
55389 int64_t ret_ref = tag_ptr(ret_copy, true);
55393 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1pub_1key_1hash_1length(JNIEnv *env, jclass clz) {
55394 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55395 *ret_copy = ParseError_invalid_pub_key_hash_length();
55396 int64_t ret_ref = tag_ptr(ret_copy, true);
55400 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1script_1hash_1length(JNIEnv *env, jclass clz) {
55401 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55402 *ret_copy = ParseError_invalid_script_hash_length();
55403 int64_t ret_ref = tag_ptr(ret_copy, true);
55407 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1recovery_1id(JNIEnv *env, jclass clz) {
55408 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55409 *ret_copy = ParseError_invalid_recovery_id();
55410 int64_t ret_ref = tag_ptr(ret_copy, true);
55414 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1invalid_1slice_1length(JNIEnv *env, jclass clz, jstring a) {
55415 LDKStr a_conv = java_to_owned_str(env, a);
55416 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55417 *ret_copy = ParseError_invalid_slice_length(a_conv);
55418 int64_t ret_ref = tag_ptr(ret_copy, true);
55422 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseError_1skip(JNIEnv *env, jclass clz) {
55423 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
55424 *ret_copy = ParseError_skip();
55425 int64_t ret_ref = tag_ptr(ret_copy, true);
55429 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ParseError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
55430 LDKParseError* a_conv = (LDKParseError*)untag_ptr(a);
55431 LDKParseError* b_conv = (LDKParseError*)untag_ptr(b);
55432 jboolean ret_conv = ParseError_eq(a_conv, b_conv);
55436 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
55437 if (!ptr_is_owned(this_ptr)) return;
55438 void* this_ptr_ptr = untag_ptr(this_ptr);
55439 CHECK_ACCESS(this_ptr_ptr);
55440 LDKParseOrSemanticError this_ptr_conv = *(LDKParseOrSemanticError*)(this_ptr_ptr);
55441 FREE(untag_ptr(this_ptr));
55442 ParseOrSemanticError_free(this_ptr_conv);
55445 static inline uint64_t ParseOrSemanticError_clone_ptr(LDKParseOrSemanticError *NONNULL_PTR arg) {
55446 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
55447 *ret_copy = ParseOrSemanticError_clone(arg);
55448 int64_t ret_ref = tag_ptr(ret_copy, true);
55451 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
55452 LDKParseOrSemanticError* arg_conv = (LDKParseOrSemanticError*)untag_ptr(arg);
55453 int64_t ret_conv = ParseOrSemanticError_clone_ptr(arg_conv);
55457 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
55458 LDKParseOrSemanticError* orig_conv = (LDKParseOrSemanticError*)untag_ptr(orig);
55459 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
55460 *ret_copy = ParseOrSemanticError_clone(orig_conv);
55461 int64_t ret_ref = tag_ptr(ret_copy, true);
55465 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1parse_1error(JNIEnv *env, jclass clz, int64_t a) {
55466 void* a_ptr = untag_ptr(a);
55467 CHECK_ACCESS(a_ptr);
55468 LDKParseError a_conv = *(LDKParseError*)(a_ptr);
55469 a_conv = ParseError_clone((LDKParseError*)untag_ptr(a));
55470 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
55471 *ret_copy = ParseOrSemanticError_parse_error(a_conv);
55472 int64_t ret_ref = tag_ptr(ret_copy, true);
55476 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1semantic_1error(JNIEnv *env, jclass clz, jclass a) {
55477 LDKSemanticError a_conv = LDKSemanticError_from_java(env, a);
55478 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
55479 *ret_copy = ParseOrSemanticError_semantic_error(a_conv);
55480 int64_t ret_ref = tag_ptr(ret_copy, true);
55484 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
55485 LDKParseOrSemanticError* a_conv = (LDKParseOrSemanticError*)untag_ptr(a);
55486 LDKParseOrSemanticError* b_conv = (LDKParseOrSemanticError*)untag_ptr(b);
55487 jboolean ret_conv = ParseOrSemanticError_eq(a_conv, b_conv);
55491 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Invoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
55492 LDKInvoice this_obj_conv;
55493 this_obj_conv.inner = untag_ptr(this_obj);
55494 this_obj_conv.is_owned = ptr_is_owned(this_obj);
55495 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
55496 Invoice_free(this_obj_conv);
55499 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
55501 a_conv.inner = untag_ptr(a);
55502 a_conv.is_owned = ptr_is_owned(a);
55503 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
55504 a_conv.is_owned = false;
55506 b_conv.inner = untag_ptr(b);
55507 b_conv.is_owned = ptr_is_owned(b);
55508 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
55509 b_conv.is_owned = false;
55510 jboolean ret_conv = Invoice_eq(&a_conv, &b_conv);
55514 static inline uint64_t Invoice_clone_ptr(LDKInvoice *NONNULL_PTR arg) {
55515 LDKInvoice ret_var = Invoice_clone(arg);
55516 int64_t ret_ref = 0;
55517 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
55518 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
55521 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
55522 LDKInvoice arg_conv;
55523 arg_conv.inner = untag_ptr(arg);
55524 arg_conv.is_owned = ptr_is_owned(arg);
55525 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
55526 arg_conv.is_owned = false;
55527 int64_t ret_conv = Invoice_clone_ptr(&arg_conv);
55531 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1clone(JNIEnv *env, jclass clz, int64_t orig) {
55532 LDKInvoice orig_conv;
55533 orig_conv.inner = untag_ptr(orig);
55534 orig_conv.is_owned = ptr_is_owned(orig);
55535 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
55536 orig_conv.is_owned = false;
55537 LDKInvoice ret_var = Invoice_clone(&orig_conv);
55538 int64_t ret_ref = 0;
55539 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
55540 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
55544 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1hash(JNIEnv *env, jclass clz, int64_t o) {
55546 o_conv.inner = untag_ptr(o);
55547 o_conv.is_owned = ptr_is_owned(o);
55548 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
55549 o_conv.is_owned = false;
55550 int64_t ret_conv = Invoice_hash(&o_conv);
55554 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
55555 LDKSignedRawInvoice this_obj_conv;
55556 this_obj_conv.inner = untag_ptr(this_obj);
55557 this_obj_conv.is_owned = ptr_is_owned(this_obj);
55558 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
55559 SignedRawInvoice_free(this_obj_conv);
55562 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
55563 LDKSignedRawInvoice a_conv;
55564 a_conv.inner = untag_ptr(a);
55565 a_conv.is_owned = ptr_is_owned(a);
55566 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
55567 a_conv.is_owned = false;
55568 LDKSignedRawInvoice b_conv;
55569 b_conv.inner = untag_ptr(b);
55570 b_conv.is_owned = ptr_is_owned(b);
55571 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
55572 b_conv.is_owned = false;
55573 jboolean ret_conv = SignedRawInvoice_eq(&a_conv, &b_conv);
55577 static inline uint64_t SignedRawInvoice_clone_ptr(LDKSignedRawInvoice *NONNULL_PTR arg) {
55578 LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(arg);
55579 int64_t ret_ref = 0;
55580 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
55581 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
55584 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
55585 LDKSignedRawInvoice arg_conv;
55586 arg_conv.inner = untag_ptr(arg);
55587 arg_conv.is_owned = ptr_is_owned(arg);
55588 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
55589 arg_conv.is_owned = false;
55590 int64_t ret_conv = SignedRawInvoice_clone_ptr(&arg_conv);
55594 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1clone(JNIEnv *env, jclass clz, int64_t orig) {
55595 LDKSignedRawInvoice orig_conv;
55596 orig_conv.inner = untag_ptr(orig);
55597 orig_conv.is_owned = ptr_is_owned(orig);
55598 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
55599 orig_conv.is_owned = false;
55600 LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(&orig_conv);
55601 int64_t ret_ref = 0;
55602 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
55603 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
55607 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1hash(JNIEnv *env, jclass clz, int64_t o) {
55608 LDKSignedRawInvoice o_conv;
55609 o_conv.inner = untag_ptr(o);
55610 o_conv.is_owned = ptr_is_owned(o);
55611 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
55612 o_conv.is_owned = false;
55613 int64_t ret_conv = SignedRawInvoice_hash(&o_conv);
55617 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawInvoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
55618 LDKRawInvoice this_obj_conv;
55619 this_obj_conv.inner = untag_ptr(this_obj);
55620 this_obj_conv.is_owned = ptr_is_owned(this_obj);
55621 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
55622 RawInvoice_free(this_obj_conv);
55625 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1get_1data(JNIEnv *env, jclass clz, int64_t this_ptr) {
55626 LDKRawInvoice this_ptr_conv;
55627 this_ptr_conv.inner = untag_ptr(this_ptr);
55628 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
55629 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
55630 this_ptr_conv.is_owned = false;
55631 LDKRawDataPart ret_var = RawInvoice_get_data(&this_ptr_conv);
55632 int64_t ret_ref = 0;
55633 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
55634 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
55638 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawInvoice_1set_1data(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
55639 LDKRawInvoice this_ptr_conv;
55640 this_ptr_conv.inner = untag_ptr(this_ptr);
55641 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
55642 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
55643 this_ptr_conv.is_owned = false;
55644 LDKRawDataPart val_conv;
55645 val_conv.inner = untag_ptr(val);
55646 val_conv.is_owned = ptr_is_owned(val);
55647 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
55648 val_conv = RawDataPart_clone(&val_conv);
55649 RawInvoice_set_data(&this_ptr_conv, val_conv);
55652 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RawInvoice_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
55653 LDKRawInvoice a_conv;
55654 a_conv.inner = untag_ptr(a);
55655 a_conv.is_owned = ptr_is_owned(a);
55656 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
55657 a_conv.is_owned = false;
55658 LDKRawInvoice b_conv;
55659 b_conv.inner = untag_ptr(b);
55660 b_conv.is_owned = ptr_is_owned(b);
55661 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
55662 b_conv.is_owned = false;
55663 jboolean ret_conv = RawInvoice_eq(&a_conv, &b_conv);
55667 static inline uint64_t RawInvoice_clone_ptr(LDKRawInvoice *NONNULL_PTR arg) {
55668 LDKRawInvoice ret_var = RawInvoice_clone(arg);
55669 int64_t ret_ref = 0;
55670 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
55671 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
55674 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
55675 LDKRawInvoice arg_conv;
55676 arg_conv.inner = untag_ptr(arg);
55677 arg_conv.is_owned = ptr_is_owned(arg);
55678 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
55679 arg_conv.is_owned = false;
55680 int64_t ret_conv = RawInvoice_clone_ptr(&arg_conv);
55684 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1clone(JNIEnv *env, jclass clz, int64_t orig) {
55685 LDKRawInvoice orig_conv;
55686 orig_conv.inner = untag_ptr(orig);
55687 orig_conv.is_owned = ptr_is_owned(orig);
55688 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
55689 orig_conv.is_owned = false;
55690 LDKRawInvoice ret_var = RawInvoice_clone(&orig_conv);
55691 int64_t ret_ref = 0;
55692 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
55693 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
55697 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1hash(JNIEnv *env, jclass clz, int64_t o) {
55698 LDKRawInvoice o_conv;
55699 o_conv.inner = untag_ptr(o);
55700 o_conv.is_owned = ptr_is_owned(o);
55701 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
55702 o_conv.is_owned = false;
55703 int64_t ret_conv = RawInvoice_hash(&o_conv);
55707 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawDataPart_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
55708 LDKRawDataPart this_obj_conv;
55709 this_obj_conv.inner = untag_ptr(this_obj);
55710 this_obj_conv.is_owned = ptr_is_owned(this_obj);
55711 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
55712 RawDataPart_free(this_obj_conv);
55715 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1get_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr) {
55716 LDKRawDataPart this_ptr_conv;
55717 this_ptr_conv.inner = untag_ptr(this_ptr);
55718 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
55719 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
55720 this_ptr_conv.is_owned = false;
55721 LDKPositiveTimestamp ret_var = RawDataPart_get_timestamp(&this_ptr_conv);
55722 int64_t ret_ref = 0;
55723 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
55724 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
55728 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RawDataPart_1set_1timestamp(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
55729 LDKRawDataPart this_ptr_conv;
55730 this_ptr_conv.inner = untag_ptr(this_ptr);
55731 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
55732 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
55733 this_ptr_conv.is_owned = false;
55734 LDKPositiveTimestamp val_conv;
55735 val_conv.inner = untag_ptr(val);
55736 val_conv.is_owned = ptr_is_owned(val);
55737 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
55738 val_conv = PositiveTimestamp_clone(&val_conv);
55739 RawDataPart_set_timestamp(&this_ptr_conv, val_conv);
55742 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RawDataPart_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
55743 LDKRawDataPart a_conv;
55744 a_conv.inner = untag_ptr(a);
55745 a_conv.is_owned = ptr_is_owned(a);
55746 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
55747 a_conv.is_owned = false;
55748 LDKRawDataPart b_conv;
55749 b_conv.inner = untag_ptr(b);
55750 b_conv.is_owned = ptr_is_owned(b);
55751 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
55752 b_conv.is_owned = false;
55753 jboolean ret_conv = RawDataPart_eq(&a_conv, &b_conv);
55757 static inline uint64_t RawDataPart_clone_ptr(LDKRawDataPart *NONNULL_PTR arg) {
55758 LDKRawDataPart ret_var = RawDataPart_clone(arg);
55759 int64_t ret_ref = 0;
55760 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
55761 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
55764 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
55765 LDKRawDataPart arg_conv;
55766 arg_conv.inner = untag_ptr(arg);
55767 arg_conv.is_owned = ptr_is_owned(arg);
55768 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
55769 arg_conv.is_owned = false;
55770 int64_t ret_conv = RawDataPart_clone_ptr(&arg_conv);
55774 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1clone(JNIEnv *env, jclass clz, int64_t orig) {
55775 LDKRawDataPart orig_conv;
55776 orig_conv.inner = untag_ptr(orig);
55777 orig_conv.is_owned = ptr_is_owned(orig);
55778 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
55779 orig_conv.is_owned = false;
55780 LDKRawDataPart ret_var = RawDataPart_clone(&orig_conv);
55781 int64_t ret_ref = 0;
55782 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
55783 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
55787 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawDataPart_1hash(JNIEnv *env, jclass clz, int64_t o) {
55788 LDKRawDataPart o_conv;
55789 o_conv.inner = untag_ptr(o);
55790 o_conv.is_owned = ptr_is_owned(o);
55791 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
55792 o_conv.is_owned = false;
55793 int64_t ret_conv = RawDataPart_hash(&o_conv);
55797 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
55798 LDKPositiveTimestamp this_obj_conv;
55799 this_obj_conv.inner = untag_ptr(this_obj);
55800 this_obj_conv.is_owned = ptr_is_owned(this_obj);
55801 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
55802 PositiveTimestamp_free(this_obj_conv);
55805 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
55806 LDKPositiveTimestamp a_conv;
55807 a_conv.inner = untag_ptr(a);
55808 a_conv.is_owned = ptr_is_owned(a);
55809 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
55810 a_conv.is_owned = false;
55811 LDKPositiveTimestamp b_conv;
55812 b_conv.inner = untag_ptr(b);
55813 b_conv.is_owned = ptr_is_owned(b);
55814 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
55815 b_conv.is_owned = false;
55816 jboolean ret_conv = PositiveTimestamp_eq(&a_conv, &b_conv);
55820 static inline uint64_t PositiveTimestamp_clone_ptr(LDKPositiveTimestamp *NONNULL_PTR arg) {
55821 LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(arg);
55822 int64_t ret_ref = 0;
55823 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
55824 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
55827 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
55828 LDKPositiveTimestamp arg_conv;
55829 arg_conv.inner = untag_ptr(arg);
55830 arg_conv.is_owned = ptr_is_owned(arg);
55831 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
55832 arg_conv.is_owned = false;
55833 int64_t ret_conv = PositiveTimestamp_clone_ptr(&arg_conv);
55837 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1clone(JNIEnv *env, jclass clz, int64_t orig) {
55838 LDKPositiveTimestamp orig_conv;
55839 orig_conv.inner = untag_ptr(orig);
55840 orig_conv.is_owned = ptr_is_owned(orig);
55841 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
55842 orig_conv.is_owned = false;
55843 LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(&orig_conv);
55844 int64_t ret_ref = 0;
55845 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
55846 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
55850 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1hash(JNIEnv *env, jclass clz, int64_t o) {
55851 LDKPositiveTimestamp o_conv;
55852 o_conv.inner = untag_ptr(o);
55853 o_conv.is_owned = ptr_is_owned(o);
55854 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
55855 o_conv.is_owned = false;
55856 int64_t ret_conv = PositiveTimestamp_hash(&o_conv);
55860 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1clone(JNIEnv *env, jclass clz, int64_t orig) {
55861 LDKSiPrefix* orig_conv = (LDKSiPrefix*)untag_ptr(orig);
55862 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_clone(orig_conv));
55866 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1milli(JNIEnv *env, jclass clz) {
55867 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_milli());
55871 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1micro(JNIEnv *env, jclass clz) {
55872 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_micro());
55876 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1nano(JNIEnv *env, jclass clz) {
55877 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_nano());
55881 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1pico(JNIEnv *env, jclass clz) {
55882 jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_pico());
55886 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SiPrefix_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
55887 LDKSiPrefix* a_conv = (LDKSiPrefix*)untag_ptr(a);
55888 LDKSiPrefix* b_conv = (LDKSiPrefix*)untag_ptr(b);
55889 jboolean ret_conv = SiPrefix_eq(a_conv, b_conv);
55893 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SiPrefix_1hash(JNIEnv *env, jclass clz, int64_t o) {
55894 LDKSiPrefix* o_conv = (LDKSiPrefix*)untag_ptr(o);
55895 int64_t ret_conv = SiPrefix_hash(o_conv);
55899 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SiPrefix_1multiplier(JNIEnv *env, jclass clz, int64_t this_arg) {
55900 LDKSiPrefix* this_arg_conv = (LDKSiPrefix*)untag_ptr(this_arg);
55901 int64_t ret_conv = SiPrefix_multiplier(this_arg_conv);
55905 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1clone(JNIEnv *env, jclass clz, int64_t orig) {
55906 LDKCurrency* orig_conv = (LDKCurrency*)untag_ptr(orig);
55907 jclass ret_conv = LDKCurrency_to_java(env, Currency_clone(orig_conv));
55911 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1bitcoin(JNIEnv *env, jclass clz) {
55912 jclass ret_conv = LDKCurrency_to_java(env, Currency_bitcoin());
55916 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1bitcoin_1testnet(JNIEnv *env, jclass clz) {
55917 jclass ret_conv = LDKCurrency_to_java(env, Currency_bitcoin_testnet());
55921 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1regtest(JNIEnv *env, jclass clz) {
55922 jclass ret_conv = LDKCurrency_to_java(env, Currency_regtest());
55926 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1simnet(JNIEnv *env, jclass clz) {
55927 jclass ret_conv = LDKCurrency_to_java(env, Currency_simnet());
55931 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1signet(JNIEnv *env, jclass clz) {
55932 jclass ret_conv = LDKCurrency_to_java(env, Currency_signet());
55936 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Currency_1hash(JNIEnv *env, jclass clz, int64_t o) {
55937 LDKCurrency* o_conv = (LDKCurrency*)untag_ptr(o);
55938 int64_t ret_conv = Currency_hash(o_conv);
55942 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Currency_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
55943 LDKCurrency* a_conv = (LDKCurrency*)untag_ptr(a);
55944 LDKCurrency* b_conv = (LDKCurrency*)untag_ptr(b);
55945 jboolean ret_conv = Currency_eq(a_conv, b_conv);
55949 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Sha256_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
55950 LDKSha256 this_obj_conv;
55951 this_obj_conv.inner = untag_ptr(this_obj);
55952 this_obj_conv.is_owned = ptr_is_owned(this_obj);
55953 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
55954 Sha256_free(this_obj_conv);
55957 static inline uint64_t Sha256_clone_ptr(LDKSha256 *NONNULL_PTR arg) {
55958 LDKSha256 ret_var = Sha256_clone(arg);
55959 int64_t ret_ref = 0;
55960 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
55961 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
55964 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
55965 LDKSha256 arg_conv;
55966 arg_conv.inner = untag_ptr(arg);
55967 arg_conv.is_owned = ptr_is_owned(arg);
55968 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
55969 arg_conv.is_owned = false;
55970 int64_t ret_conv = Sha256_clone_ptr(&arg_conv);
55974 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1clone(JNIEnv *env, jclass clz, int64_t orig) {
55975 LDKSha256 orig_conv;
55976 orig_conv.inner = untag_ptr(orig);
55977 orig_conv.is_owned = ptr_is_owned(orig);
55978 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
55979 orig_conv.is_owned = false;
55980 LDKSha256 ret_var = Sha256_clone(&orig_conv);
55981 int64_t ret_ref = 0;
55982 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
55983 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
55987 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1hash(JNIEnv *env, jclass clz, int64_t o) {
55989 o_conv.inner = untag_ptr(o);
55990 o_conv.is_owned = ptr_is_owned(o);
55991 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
55992 o_conv.is_owned = false;
55993 int64_t ret_conv = Sha256_hash(&o_conv);
55997 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Sha256_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
55999 a_conv.inner = untag_ptr(a);
56000 a_conv.is_owned = ptr_is_owned(a);
56001 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
56002 a_conv.is_owned = false;
56004 b_conv.inner = untag_ptr(b);
56005 b_conv.is_owned = ptr_is_owned(b);
56006 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
56007 b_conv.is_owned = false;
56008 jboolean ret_conv = Sha256_eq(&a_conv, &b_conv);
56012 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Sha256_1from_1bytes(JNIEnv *env, jclass clz, int8_tArray bytes) {
56013 uint8_t bytes_arr[32];
56014 CHECK((*env)->GetArrayLength(env, bytes) == 32);
56015 (*env)->GetByteArrayRegion(env, bytes, 0, 32, bytes_arr);
56016 uint8_t (*bytes_ref)[32] = &bytes_arr;
56017 LDKSha256 ret_var = Sha256_from_bytes(bytes_ref);
56018 int64_t ret_ref = 0;
56019 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56020 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56024 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Description_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
56025 LDKDescription this_obj_conv;
56026 this_obj_conv.inner = untag_ptr(this_obj);
56027 this_obj_conv.is_owned = ptr_is_owned(this_obj);
56028 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
56029 Description_free(this_obj_conv);
56032 static inline uint64_t Description_clone_ptr(LDKDescription *NONNULL_PTR arg) {
56033 LDKDescription ret_var = Description_clone(arg);
56034 int64_t ret_ref = 0;
56035 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56036 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56039 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
56040 LDKDescription arg_conv;
56041 arg_conv.inner = untag_ptr(arg);
56042 arg_conv.is_owned = ptr_is_owned(arg);
56043 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
56044 arg_conv.is_owned = false;
56045 int64_t ret_conv = Description_clone_ptr(&arg_conv);
56049 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1clone(JNIEnv *env, jclass clz, int64_t orig) {
56050 LDKDescription orig_conv;
56051 orig_conv.inner = untag_ptr(orig);
56052 orig_conv.is_owned = ptr_is_owned(orig);
56053 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
56054 orig_conv.is_owned = false;
56055 LDKDescription ret_var = Description_clone(&orig_conv);
56056 int64_t ret_ref = 0;
56057 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56058 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56062 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1hash(JNIEnv *env, jclass clz, int64_t o) {
56063 LDKDescription o_conv;
56064 o_conv.inner = untag_ptr(o);
56065 o_conv.is_owned = ptr_is_owned(o);
56066 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
56067 o_conv.is_owned = false;
56068 int64_t ret_conv = Description_hash(&o_conv);
56072 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Description_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
56073 LDKDescription a_conv;
56074 a_conv.inner = untag_ptr(a);
56075 a_conv.is_owned = ptr_is_owned(a);
56076 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
56077 a_conv.is_owned = false;
56078 LDKDescription b_conv;
56079 b_conv.inner = untag_ptr(b);
56080 b_conv.is_owned = ptr_is_owned(b);
56081 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
56082 b_conv.is_owned = false;
56083 jboolean ret_conv = Description_eq(&a_conv, &b_conv);
56087 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
56088 LDKPayeePubKey this_obj_conv;
56089 this_obj_conv.inner = untag_ptr(this_obj);
56090 this_obj_conv.is_owned = ptr_is_owned(this_obj);
56091 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
56092 PayeePubKey_free(this_obj_conv);
56095 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
56096 LDKPayeePubKey this_ptr_conv;
56097 this_ptr_conv.inner = untag_ptr(this_ptr);
56098 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
56099 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
56100 this_ptr_conv.is_owned = false;
56101 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
56102 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, PayeePubKey_get_a(&this_ptr_conv).compressed_form);
56106 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) {
56107 LDKPayeePubKey this_ptr_conv;
56108 this_ptr_conv.inner = untag_ptr(this_ptr);
56109 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
56110 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
56111 this_ptr_conv.is_owned = false;
56112 LDKPublicKey val_ref;
56113 CHECK((*env)->GetArrayLength(env, val) == 33);
56114 (*env)->GetByteArrayRegion(env, val, 0, 33, val_ref.compressed_form);
56115 PayeePubKey_set_a(&this_ptr_conv, val_ref);
56118 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1new(JNIEnv *env, jclass clz, int8_tArray a_arg) {
56119 LDKPublicKey a_arg_ref;
56120 CHECK((*env)->GetArrayLength(env, a_arg) == 33);
56121 (*env)->GetByteArrayRegion(env, a_arg, 0, 33, a_arg_ref.compressed_form);
56122 LDKPayeePubKey ret_var = PayeePubKey_new(a_arg_ref);
56123 int64_t ret_ref = 0;
56124 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56125 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56129 static inline uint64_t PayeePubKey_clone_ptr(LDKPayeePubKey *NONNULL_PTR arg) {
56130 LDKPayeePubKey ret_var = PayeePubKey_clone(arg);
56131 int64_t ret_ref = 0;
56132 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56133 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56136 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
56137 LDKPayeePubKey arg_conv;
56138 arg_conv.inner = untag_ptr(arg);
56139 arg_conv.is_owned = ptr_is_owned(arg);
56140 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
56141 arg_conv.is_owned = false;
56142 int64_t ret_conv = PayeePubKey_clone_ptr(&arg_conv);
56146 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1clone(JNIEnv *env, jclass clz, int64_t orig) {
56147 LDKPayeePubKey orig_conv;
56148 orig_conv.inner = untag_ptr(orig);
56149 orig_conv.is_owned = ptr_is_owned(orig);
56150 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
56151 orig_conv.is_owned = false;
56152 LDKPayeePubKey ret_var = PayeePubKey_clone(&orig_conv);
56153 int64_t ret_ref = 0;
56154 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56155 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56159 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1hash(JNIEnv *env, jclass clz, int64_t o) {
56160 LDKPayeePubKey o_conv;
56161 o_conv.inner = untag_ptr(o);
56162 o_conv.is_owned = ptr_is_owned(o);
56163 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
56164 o_conv.is_owned = false;
56165 int64_t ret_conv = PayeePubKey_hash(&o_conv);
56169 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PayeePubKey_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
56170 LDKPayeePubKey a_conv;
56171 a_conv.inner = untag_ptr(a);
56172 a_conv.is_owned = ptr_is_owned(a);
56173 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
56174 a_conv.is_owned = false;
56175 LDKPayeePubKey b_conv;
56176 b_conv.inner = untag_ptr(b);
56177 b_conv.is_owned = ptr_is_owned(b);
56178 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
56179 b_conv.is_owned = false;
56180 jboolean ret_conv = PayeePubKey_eq(&a_conv, &b_conv);
56184 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
56185 LDKExpiryTime this_obj_conv;
56186 this_obj_conv.inner = untag_ptr(this_obj);
56187 this_obj_conv.is_owned = ptr_is_owned(this_obj);
56188 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
56189 ExpiryTime_free(this_obj_conv);
56192 static inline uint64_t ExpiryTime_clone_ptr(LDKExpiryTime *NONNULL_PTR arg) {
56193 LDKExpiryTime ret_var = ExpiryTime_clone(arg);
56194 int64_t ret_ref = 0;
56195 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56196 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56199 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
56200 LDKExpiryTime arg_conv;
56201 arg_conv.inner = untag_ptr(arg);
56202 arg_conv.is_owned = ptr_is_owned(arg);
56203 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
56204 arg_conv.is_owned = false;
56205 int64_t ret_conv = ExpiryTime_clone_ptr(&arg_conv);
56209 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1clone(JNIEnv *env, jclass clz, int64_t orig) {
56210 LDKExpiryTime orig_conv;
56211 orig_conv.inner = untag_ptr(orig);
56212 orig_conv.is_owned = ptr_is_owned(orig);
56213 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
56214 orig_conv.is_owned = false;
56215 LDKExpiryTime ret_var = ExpiryTime_clone(&orig_conv);
56216 int64_t ret_ref = 0;
56217 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56218 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56222 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1hash(JNIEnv *env, jclass clz, int64_t o) {
56223 LDKExpiryTime o_conv;
56224 o_conv.inner = untag_ptr(o);
56225 o_conv.is_owned = ptr_is_owned(o);
56226 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
56227 o_conv.is_owned = false;
56228 int64_t ret_conv = ExpiryTime_hash(&o_conv);
56232 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
56233 LDKExpiryTime a_conv;
56234 a_conv.inner = untag_ptr(a);
56235 a_conv.is_owned = ptr_is_owned(a);
56236 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
56237 a_conv.is_owned = false;
56238 LDKExpiryTime b_conv;
56239 b_conv.inner = untag_ptr(b);
56240 b_conv.is_owned = ptr_is_owned(b);
56241 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
56242 b_conv.is_owned = false;
56243 jboolean ret_conv = ExpiryTime_eq(&a_conv, &b_conv);
56247 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiryDelta_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
56248 LDKMinFinalCltvExpiryDelta this_obj_conv;
56249 this_obj_conv.inner = untag_ptr(this_obj);
56250 this_obj_conv.is_owned = ptr_is_owned(this_obj);
56251 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
56252 MinFinalCltvExpiryDelta_free(this_obj_conv);
56255 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiryDelta_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) {
56256 LDKMinFinalCltvExpiryDelta this_ptr_conv;
56257 this_ptr_conv.inner = untag_ptr(this_ptr);
56258 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
56259 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
56260 this_ptr_conv.is_owned = false;
56261 int64_t ret_conv = MinFinalCltvExpiryDelta_get_a(&this_ptr_conv);
56265 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiryDelta_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
56266 LDKMinFinalCltvExpiryDelta this_ptr_conv;
56267 this_ptr_conv.inner = untag_ptr(this_ptr);
56268 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
56269 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
56270 this_ptr_conv.is_owned = false;
56271 MinFinalCltvExpiryDelta_set_a(&this_ptr_conv, val);
56274 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiryDelta_1new(JNIEnv *env, jclass clz, int64_t a_arg) {
56275 LDKMinFinalCltvExpiryDelta ret_var = MinFinalCltvExpiryDelta_new(a_arg);
56276 int64_t ret_ref = 0;
56277 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56278 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56282 static inline uint64_t MinFinalCltvExpiryDelta_clone_ptr(LDKMinFinalCltvExpiryDelta *NONNULL_PTR arg) {
56283 LDKMinFinalCltvExpiryDelta ret_var = MinFinalCltvExpiryDelta_clone(arg);
56284 int64_t ret_ref = 0;
56285 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56286 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56289 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiryDelta_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
56290 LDKMinFinalCltvExpiryDelta arg_conv;
56291 arg_conv.inner = untag_ptr(arg);
56292 arg_conv.is_owned = ptr_is_owned(arg);
56293 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
56294 arg_conv.is_owned = false;
56295 int64_t ret_conv = MinFinalCltvExpiryDelta_clone_ptr(&arg_conv);
56299 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiryDelta_1clone(JNIEnv *env, jclass clz, int64_t orig) {
56300 LDKMinFinalCltvExpiryDelta orig_conv;
56301 orig_conv.inner = untag_ptr(orig);
56302 orig_conv.is_owned = ptr_is_owned(orig);
56303 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
56304 orig_conv.is_owned = false;
56305 LDKMinFinalCltvExpiryDelta ret_var = MinFinalCltvExpiryDelta_clone(&orig_conv);
56306 int64_t ret_ref = 0;
56307 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56308 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56312 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiryDelta_1hash(JNIEnv *env, jclass clz, int64_t o) {
56313 LDKMinFinalCltvExpiryDelta o_conv;
56314 o_conv.inner = untag_ptr(o);
56315 o_conv.is_owned = ptr_is_owned(o);
56316 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
56317 o_conv.is_owned = false;
56318 int64_t ret_conv = MinFinalCltvExpiryDelta_hash(&o_conv);
56322 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MinFinalCltvExpiryDelta_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
56323 LDKMinFinalCltvExpiryDelta a_conv;
56324 a_conv.inner = untag_ptr(a);
56325 a_conv.is_owned = ptr_is_owned(a);
56326 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
56327 a_conv.is_owned = false;
56328 LDKMinFinalCltvExpiryDelta b_conv;
56329 b_conv.inner = untag_ptr(b);
56330 b_conv.is_owned = ptr_is_owned(b);
56331 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
56332 b_conv.is_owned = false;
56333 jboolean ret_conv = MinFinalCltvExpiryDelta_eq(&a_conv, &b_conv);
56337 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Fallback_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
56338 if (!ptr_is_owned(this_ptr)) return;
56339 void* this_ptr_ptr = untag_ptr(this_ptr);
56340 CHECK_ACCESS(this_ptr_ptr);
56341 LDKFallback this_ptr_conv = *(LDKFallback*)(this_ptr_ptr);
56342 FREE(untag_ptr(this_ptr));
56343 Fallback_free(this_ptr_conv);
56346 static inline uint64_t Fallback_clone_ptr(LDKFallback *NONNULL_PTR arg) {
56347 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
56348 *ret_copy = Fallback_clone(arg);
56349 int64_t ret_ref = tag_ptr(ret_copy, true);
56352 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
56353 LDKFallback* arg_conv = (LDKFallback*)untag_ptr(arg);
56354 int64_t ret_conv = Fallback_clone_ptr(arg_conv);
56358 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1clone(JNIEnv *env, jclass clz, int64_t orig) {
56359 LDKFallback* orig_conv = (LDKFallback*)untag_ptr(orig);
56360 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
56361 *ret_copy = Fallback_clone(orig_conv);
56362 int64_t ret_ref = tag_ptr(ret_copy, true);
56366 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1seg_1wit_1program(JNIEnv *env, jclass clz, int8_t version, int8_tArray program) {
56368 LDKCVec_u8Z program_ref;
56369 program_ref.datalen = (*env)->GetArrayLength(env, program);
56370 program_ref.data = MALLOC(program_ref.datalen, "LDKCVec_u8Z Bytes");
56371 (*env)->GetByteArrayRegion(env, program, 0, program_ref.datalen, program_ref.data);
56372 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
56373 *ret_copy = Fallback_seg_wit_program((LDKWitnessVersion){ ._0 = version }, program_ref);
56374 int64_t ret_ref = tag_ptr(ret_copy, true);
56378 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1pub_1key_1hash(JNIEnv *env, jclass clz, int8_tArray a) {
56379 LDKTwentyBytes a_ref;
56380 CHECK((*env)->GetArrayLength(env, a) == 20);
56381 (*env)->GetByteArrayRegion(env, a, 0, 20, a_ref.data);
56382 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
56383 *ret_copy = Fallback_pub_key_hash(a_ref);
56384 int64_t ret_ref = tag_ptr(ret_copy, true);
56388 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1script_1hash(JNIEnv *env, jclass clz, int8_tArray a) {
56389 LDKTwentyBytes a_ref;
56390 CHECK((*env)->GetArrayLength(env, a) == 20);
56391 (*env)->GetByteArrayRegion(env, a, 0, 20, a_ref.data);
56392 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
56393 *ret_copy = Fallback_script_hash(a_ref);
56394 int64_t ret_ref = tag_ptr(ret_copy, true);
56398 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1hash(JNIEnv *env, jclass clz, int64_t o) {
56399 LDKFallback* o_conv = (LDKFallback*)untag_ptr(o);
56400 int64_t ret_conv = Fallback_hash(o_conv);
56404 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Fallback_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
56405 LDKFallback* a_conv = (LDKFallback*)untag_ptr(a);
56406 LDKFallback* b_conv = (LDKFallback*)untag_ptr(b);
56407 jboolean ret_conv = Fallback_eq(a_conv, b_conv);
56411 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
56412 LDKInvoiceSignature this_obj_conv;
56413 this_obj_conv.inner = untag_ptr(this_obj);
56414 this_obj_conv.is_owned = ptr_is_owned(this_obj);
56415 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
56416 InvoiceSignature_free(this_obj_conv);
56419 static inline uint64_t InvoiceSignature_clone_ptr(LDKInvoiceSignature *NONNULL_PTR arg) {
56420 LDKInvoiceSignature ret_var = InvoiceSignature_clone(arg);
56421 int64_t ret_ref = 0;
56422 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56423 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56426 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
56427 LDKInvoiceSignature arg_conv;
56428 arg_conv.inner = untag_ptr(arg);
56429 arg_conv.is_owned = ptr_is_owned(arg);
56430 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
56431 arg_conv.is_owned = false;
56432 int64_t ret_conv = InvoiceSignature_clone_ptr(&arg_conv);
56436 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1clone(JNIEnv *env, jclass clz, int64_t orig) {
56437 LDKInvoiceSignature orig_conv;
56438 orig_conv.inner = untag_ptr(orig);
56439 orig_conv.is_owned = ptr_is_owned(orig);
56440 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
56441 orig_conv.is_owned = false;
56442 LDKInvoiceSignature ret_var = InvoiceSignature_clone(&orig_conv);
56443 int64_t ret_ref = 0;
56444 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56445 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56449 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1hash(JNIEnv *env, jclass clz, int64_t o) {
56450 LDKInvoiceSignature o_conv;
56451 o_conv.inner = untag_ptr(o);
56452 o_conv.is_owned = ptr_is_owned(o);
56453 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
56454 o_conv.is_owned = false;
56455 int64_t ret_conv = InvoiceSignature_hash(&o_conv);
56459 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceSignature_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
56460 LDKInvoiceSignature a_conv;
56461 a_conv.inner = untag_ptr(a);
56462 a_conv.is_owned = ptr_is_owned(a);
56463 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
56464 a_conv.is_owned = false;
56465 LDKInvoiceSignature b_conv;
56466 b_conv.inner = untag_ptr(b);
56467 b_conv.is_owned = ptr_is_owned(b);
56468 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
56469 b_conv.is_owned = false;
56470 jboolean ret_conv = InvoiceSignature_eq(&a_conv, &b_conv);
56474 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
56475 LDKPrivateRoute this_obj_conv;
56476 this_obj_conv.inner = untag_ptr(this_obj);
56477 this_obj_conv.is_owned = ptr_is_owned(this_obj);
56478 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
56479 PrivateRoute_free(this_obj_conv);
56482 static inline uint64_t PrivateRoute_clone_ptr(LDKPrivateRoute *NONNULL_PTR arg) {
56483 LDKPrivateRoute ret_var = PrivateRoute_clone(arg);
56484 int64_t ret_ref = 0;
56485 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56486 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56489 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
56490 LDKPrivateRoute arg_conv;
56491 arg_conv.inner = untag_ptr(arg);
56492 arg_conv.is_owned = ptr_is_owned(arg);
56493 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
56494 arg_conv.is_owned = false;
56495 int64_t ret_conv = PrivateRoute_clone_ptr(&arg_conv);
56499 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1clone(JNIEnv *env, jclass clz, int64_t orig) {
56500 LDKPrivateRoute orig_conv;
56501 orig_conv.inner = untag_ptr(orig);
56502 orig_conv.is_owned = ptr_is_owned(orig);
56503 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
56504 orig_conv.is_owned = false;
56505 LDKPrivateRoute ret_var = PrivateRoute_clone(&orig_conv);
56506 int64_t ret_ref = 0;
56507 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56508 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56512 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1hash(JNIEnv *env, jclass clz, int64_t o) {
56513 LDKPrivateRoute o_conv;
56514 o_conv.inner = untag_ptr(o);
56515 o_conv.is_owned = ptr_is_owned(o);
56516 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
56517 o_conv.is_owned = false;
56518 int64_t ret_conv = PrivateRoute_hash(&o_conv);
56522 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
56523 LDKPrivateRoute a_conv;
56524 a_conv.inner = untag_ptr(a);
56525 a_conv.is_owned = ptr_is_owned(a);
56526 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
56527 a_conv.is_owned = false;
56528 LDKPrivateRoute b_conv;
56529 b_conv.inner = untag_ptr(b);
56530 b_conv.is_owned = ptr_is_owned(b);
56531 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
56532 b_conv.is_owned = false;
56533 jboolean ret_conv = PrivateRoute_eq(&a_conv, &b_conv);
56537 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1into_1parts(JNIEnv *env, jclass clz, int64_t this_arg) {
56538 LDKSignedRawInvoice this_arg_conv;
56539 this_arg_conv.inner = untag_ptr(this_arg);
56540 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56541 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56542 this_arg_conv = SignedRawInvoice_clone(&this_arg_conv);
56543 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
56544 *ret_conv = SignedRawInvoice_into_parts(this_arg_conv);
56545 return tag_ptr(ret_conv, true);
56548 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1raw_1invoice(JNIEnv *env, jclass clz, int64_t this_arg) {
56549 LDKSignedRawInvoice this_arg_conv;
56550 this_arg_conv.inner = untag_ptr(this_arg);
56551 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56552 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56553 this_arg_conv.is_owned = false;
56554 LDKRawInvoice ret_var = SignedRawInvoice_raw_invoice(&this_arg_conv);
56555 int64_t ret_ref = 0;
56556 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56557 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56561 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1signable_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
56562 LDKSignedRawInvoice this_arg_conv;
56563 this_arg_conv.inner = untag_ptr(this_arg);
56564 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56565 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56566 this_arg_conv.is_owned = false;
56567 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
56568 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *SignedRawInvoice_signable_hash(&this_arg_conv));
56572 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1signature(JNIEnv *env, jclass clz, int64_t this_arg) {
56573 LDKSignedRawInvoice this_arg_conv;
56574 this_arg_conv.inner = untag_ptr(this_arg);
56575 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56576 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56577 this_arg_conv.is_owned = false;
56578 LDKInvoiceSignature ret_var = SignedRawInvoice_signature(&this_arg_conv);
56579 int64_t ret_ref = 0;
56580 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56581 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56585 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1recover_1payee_1pub_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
56586 LDKSignedRawInvoice this_arg_conv;
56587 this_arg_conv.inner = untag_ptr(this_arg);
56588 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56589 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56590 this_arg_conv.is_owned = false;
56591 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
56592 *ret_conv = SignedRawInvoice_recover_payee_pub_key(&this_arg_conv);
56593 return tag_ptr(ret_conv, true);
56596 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1check_1signature(JNIEnv *env, jclass clz, int64_t this_arg) {
56597 LDKSignedRawInvoice this_arg_conv;
56598 this_arg_conv.inner = untag_ptr(this_arg);
56599 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56600 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56601 this_arg_conv.is_owned = false;
56602 jboolean ret_conv = SignedRawInvoice_check_signature(&this_arg_conv);
56606 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1signable_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
56607 LDKRawInvoice this_arg_conv;
56608 this_arg_conv.inner = untag_ptr(this_arg);
56609 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56610 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56611 this_arg_conv.is_owned = false;
56612 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
56613 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, RawInvoice_signable_hash(&this_arg_conv).data);
56617 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
56618 LDKRawInvoice this_arg_conv;
56619 this_arg_conv.inner = untag_ptr(this_arg);
56620 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56621 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56622 this_arg_conv.is_owned = false;
56623 LDKSha256 ret_var = RawInvoice_payment_hash(&this_arg_conv);
56624 int64_t ret_ref = 0;
56625 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56626 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56630 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1description(JNIEnv *env, jclass clz, int64_t this_arg) {
56631 LDKRawInvoice this_arg_conv;
56632 this_arg_conv.inner = untag_ptr(this_arg);
56633 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56634 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56635 this_arg_conv.is_owned = false;
56636 LDKDescription ret_var = RawInvoice_description(&this_arg_conv);
56637 int64_t ret_ref = 0;
56638 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56639 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56643 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payee_1pub_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
56644 LDKRawInvoice this_arg_conv;
56645 this_arg_conv.inner = untag_ptr(this_arg);
56646 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56647 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56648 this_arg_conv.is_owned = false;
56649 LDKPayeePubKey ret_var = RawInvoice_payee_pub_key(&this_arg_conv);
56650 int64_t ret_ref = 0;
56651 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56652 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56656 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1description_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
56657 LDKRawInvoice this_arg_conv;
56658 this_arg_conv.inner = untag_ptr(this_arg);
56659 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56660 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56661 this_arg_conv.is_owned = false;
56662 LDKSha256 ret_var = RawInvoice_description_hash(&this_arg_conv);
56663 int64_t ret_ref = 0;
56664 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56665 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56669 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_arg) {
56670 LDKRawInvoice this_arg_conv;
56671 this_arg_conv.inner = untag_ptr(this_arg);
56672 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56673 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56674 this_arg_conv.is_owned = false;
56675 LDKExpiryTime ret_var = RawInvoice_expiry_time(&this_arg_conv);
56676 int64_t ret_ref = 0;
56677 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56678 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56682 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1min_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_arg) {
56683 LDKRawInvoice this_arg_conv;
56684 this_arg_conv.inner = untag_ptr(this_arg);
56685 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56686 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56687 this_arg_conv.is_owned = false;
56688 LDKMinFinalCltvExpiryDelta ret_var = RawInvoice_min_final_cltv_expiry_delta(&this_arg_conv);
56689 int64_t ret_ref = 0;
56690 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56691 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56695 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
56696 LDKRawInvoice this_arg_conv;
56697 this_arg_conv.inner = untag_ptr(this_arg);
56698 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56699 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56700 this_arg_conv.is_owned = false;
56701 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
56702 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, RawInvoice_payment_secret(&this_arg_conv).data);
56706 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) {
56707 LDKRawInvoice this_arg_conv;
56708 this_arg_conv.inner = untag_ptr(this_arg);
56709 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56710 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56711 this_arg_conv.is_owned = false;
56712 LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ");
56713 *ret_copy = RawInvoice_payment_metadata(&this_arg_conv);
56714 int64_t ret_ref = tag_ptr(ret_copy, true);
56718 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
56719 LDKRawInvoice this_arg_conv;
56720 this_arg_conv.inner = untag_ptr(this_arg);
56721 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56722 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56723 this_arg_conv.is_owned = false;
56724 LDKInvoiceFeatures ret_var = RawInvoice_features(&this_arg_conv);
56725 int64_t ret_ref = 0;
56726 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56727 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56731 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_RawInvoice_1private_1routes(JNIEnv *env, jclass clz, int64_t this_arg) {
56732 LDKRawInvoice this_arg_conv;
56733 this_arg_conv.inner = untag_ptr(this_arg);
56734 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56735 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56736 this_arg_conv.is_owned = false;
56737 LDKCVec_PrivateRouteZ ret_var = RawInvoice_private_routes(&this_arg_conv);
56738 int64_tArray ret_arr = NULL;
56739 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
56740 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
56741 for (size_t o = 0; o < ret_var.datalen; o++) {
56742 LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
56743 int64_t ret_conv_14_ref = 0;
56744 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
56745 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
56746 ret_arr_ptr[o] = ret_conv_14_ref;
56748 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
56749 FREE(ret_var.data);
56753 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RawInvoice_1amount_1pico_1btc(JNIEnv *env, jclass clz, int64_t this_arg) {
56754 LDKRawInvoice this_arg_conv;
56755 this_arg_conv.inner = untag_ptr(this_arg);
56756 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56757 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56758 this_arg_conv.is_owned = false;
56759 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
56760 *ret_copy = RawInvoice_amount_pico_btc(&this_arg_conv);
56761 int64_t ret_ref = tag_ptr(ret_copy, true);
56765 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_RawInvoice_1currency(JNIEnv *env, jclass clz, int64_t this_arg) {
56766 LDKRawInvoice this_arg_conv;
56767 this_arg_conv.inner = untag_ptr(this_arg);
56768 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56769 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56770 this_arg_conv.is_owned = false;
56771 jclass ret_conv = LDKCurrency_to_java(env, RawInvoice_currency(&this_arg_conv));
56775 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1from_1unix_1timestamp(JNIEnv *env, jclass clz, int64_t unix_seconds) {
56776 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
56777 *ret_conv = PositiveTimestamp_from_unix_timestamp(unix_seconds);
56778 return tag_ptr(ret_conv, true);
56781 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1from_1system_1time(JNIEnv *env, jclass clz, int64_t time) {
56782 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
56783 *ret_conv = PositiveTimestamp_from_system_time(time);
56784 return tag_ptr(ret_conv, true);
56787 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1from_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t duration) {
56788 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
56789 *ret_conv = PositiveTimestamp_from_duration_since_epoch(duration);
56790 return tag_ptr(ret_conv, true);
56793 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1unix_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg) {
56794 LDKPositiveTimestamp this_arg_conv;
56795 this_arg_conv.inner = untag_ptr(this_arg);
56796 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56797 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56798 this_arg_conv.is_owned = false;
56799 int64_t ret_conv = PositiveTimestamp_as_unix_timestamp(&this_arg_conv);
56803 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t this_arg) {
56804 LDKPositiveTimestamp this_arg_conv;
56805 this_arg_conv.inner = untag_ptr(this_arg);
56806 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56807 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56808 this_arg_conv.is_owned = false;
56809 int64_t ret_conv = PositiveTimestamp_as_duration_since_epoch(&this_arg_conv);
56813 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1as_1time(JNIEnv *env, jclass clz, int64_t this_arg) {
56814 LDKPositiveTimestamp this_arg_conv;
56815 this_arg_conv.inner = untag_ptr(this_arg);
56816 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56817 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56818 this_arg_conv.is_owned = false;
56819 int64_t ret_conv = PositiveTimestamp_as_time(&this_arg_conv);
56823 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1signable_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
56824 LDKInvoice this_arg_conv;
56825 this_arg_conv.inner = untag_ptr(this_arg);
56826 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56827 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56828 this_arg_conv.is_owned = false;
56829 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
56830 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, Invoice_signable_hash(&this_arg_conv).data);
56834 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1into_1signed_1raw(JNIEnv *env, jclass clz, int64_t this_arg) {
56835 LDKInvoice this_arg_conv;
56836 this_arg_conv.inner = untag_ptr(this_arg);
56837 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56838 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56839 this_arg_conv = Invoice_clone(&this_arg_conv);
56840 LDKSignedRawInvoice ret_var = Invoice_into_signed_raw(this_arg_conv);
56841 int64_t ret_ref = 0;
56842 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56843 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56847 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1check_1signature(JNIEnv *env, jclass clz, int64_t this_arg) {
56848 LDKInvoice this_arg_conv;
56849 this_arg_conv.inner = untag_ptr(this_arg);
56850 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56851 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56852 this_arg_conv.is_owned = false;
56853 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
56854 *ret_conv = Invoice_check_signature(&this_arg_conv);
56855 return tag_ptr(ret_conv, true);
56858 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1from_1signed(JNIEnv *env, jclass clz, int64_t signed_invoice) {
56859 LDKSignedRawInvoice signed_invoice_conv;
56860 signed_invoice_conv.inner = untag_ptr(signed_invoice);
56861 signed_invoice_conv.is_owned = ptr_is_owned(signed_invoice);
56862 CHECK_INNER_FIELD_ACCESS_OR_NULL(signed_invoice_conv);
56863 signed_invoice_conv = SignedRawInvoice_clone(&signed_invoice_conv);
56864 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
56865 *ret_conv = Invoice_from_signed(signed_invoice_conv);
56866 return tag_ptr(ret_conv, true);
56869 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1timestamp(JNIEnv *env, jclass clz, int64_t this_arg) {
56870 LDKInvoice this_arg_conv;
56871 this_arg_conv.inner = untag_ptr(this_arg);
56872 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56873 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56874 this_arg_conv.is_owned = false;
56875 int64_t ret_conv = Invoice_timestamp(&this_arg_conv);
56879 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t this_arg) {
56880 LDKInvoice this_arg_conv;
56881 this_arg_conv.inner = untag_ptr(this_arg);
56882 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56883 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56884 this_arg_conv.is_owned = false;
56885 int64_t ret_conv = Invoice_duration_since_epoch(&this_arg_conv);
56889 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payment_1hash(JNIEnv *env, jclass clz, int64_t this_arg) {
56890 LDKInvoice this_arg_conv;
56891 this_arg_conv.inner = untag_ptr(this_arg);
56892 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56893 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56894 this_arg_conv.is_owned = false;
56895 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
56896 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Invoice_payment_hash(&this_arg_conv));
56900 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payee_1pub_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
56901 LDKInvoice this_arg_conv;
56902 this_arg_conv.inner = untag_ptr(this_arg);
56903 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56904 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56905 this_arg_conv.is_owned = false;
56906 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
56907 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Invoice_payee_pub_key(&this_arg_conv).compressed_form);
56911 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1payment_1secret(JNIEnv *env, jclass clz, int64_t this_arg) {
56912 LDKInvoice this_arg_conv;
56913 this_arg_conv.inner = untag_ptr(this_arg);
56914 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56915 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56916 this_arg_conv.is_owned = false;
56917 int8_tArray ret_arr = (*env)->NewByteArray(env, 32);
56918 (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, *Invoice_payment_secret(&this_arg_conv));
56922 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1payment_1metadata(JNIEnv *env, jclass clz, int64_t this_arg) {
56923 LDKInvoice this_arg_conv;
56924 this_arg_conv.inner = untag_ptr(this_arg);
56925 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56926 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56927 this_arg_conv.is_owned = false;
56928 LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ");
56929 *ret_copy = Invoice_payment_metadata(&this_arg_conv);
56930 int64_t ret_ref = tag_ptr(ret_copy, true);
56934 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1features(JNIEnv *env, jclass clz, int64_t this_arg) {
56935 LDKInvoice this_arg_conv;
56936 this_arg_conv.inner = untag_ptr(this_arg);
56937 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56938 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56939 this_arg_conv.is_owned = false;
56940 LDKInvoiceFeatures ret_var = Invoice_features(&this_arg_conv);
56941 int64_t ret_ref = 0;
56942 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
56943 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
56947 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1recover_1payee_1pub_1key(JNIEnv *env, jclass clz, int64_t this_arg) {
56948 LDKInvoice this_arg_conv;
56949 this_arg_conv.inner = untag_ptr(this_arg);
56950 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56951 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56952 this_arg_conv.is_owned = false;
56953 int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
56954 (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, Invoice_recover_payee_pub_key(&this_arg_conv).compressed_form);
56958 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1expires_1at(JNIEnv *env, jclass clz, int64_t this_arg) {
56959 LDKInvoice this_arg_conv;
56960 this_arg_conv.inner = untag_ptr(this_arg);
56961 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56962 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56963 this_arg_conv.is_owned = false;
56964 LDKCOption_DurationZ *ret_copy = MALLOC(sizeof(LDKCOption_DurationZ), "LDKCOption_DurationZ");
56965 *ret_copy = Invoice_expires_at(&this_arg_conv);
56966 int64_t ret_ref = tag_ptr(ret_copy, true);
56970 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1expiry_1time(JNIEnv *env, jclass clz, int64_t this_arg) {
56971 LDKInvoice this_arg_conv;
56972 this_arg_conv.inner = untag_ptr(this_arg);
56973 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56974 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56975 this_arg_conv.is_owned = false;
56976 int64_t ret_conv = Invoice_expiry_time(&this_arg_conv);
56980 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1is_1expired(JNIEnv *env, jclass clz, int64_t this_arg) {
56981 LDKInvoice this_arg_conv;
56982 this_arg_conv.inner = untag_ptr(this_arg);
56983 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56984 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56985 this_arg_conv.is_owned = false;
56986 jboolean ret_conv = Invoice_is_expired(&this_arg_conv);
56990 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1duration_1until_1expiry(JNIEnv *env, jclass clz, int64_t this_arg) {
56991 LDKInvoice this_arg_conv;
56992 this_arg_conv.inner = untag_ptr(this_arg);
56993 this_arg_conv.is_owned = ptr_is_owned(this_arg);
56994 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
56995 this_arg_conv.is_owned = false;
56996 int64_t ret_conv = Invoice_duration_until_expiry(&this_arg_conv);
57000 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1expiration_1remaining_1from_1epoch(JNIEnv *env, jclass clz, int64_t this_arg, int64_t time) {
57001 LDKInvoice this_arg_conv;
57002 this_arg_conv.inner = untag_ptr(this_arg);
57003 this_arg_conv.is_owned = ptr_is_owned(this_arg);
57004 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
57005 this_arg_conv.is_owned = false;
57006 int64_t ret_conv = Invoice_expiration_remaining_from_epoch(&this_arg_conv, time);
57010 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Invoice_1would_1expire(JNIEnv *env, jclass clz, int64_t this_arg, int64_t at_time) {
57011 LDKInvoice this_arg_conv;
57012 this_arg_conv.inner = untag_ptr(this_arg);
57013 this_arg_conv.is_owned = ptr_is_owned(this_arg);
57014 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
57015 this_arg_conv.is_owned = false;
57016 jboolean ret_conv = Invoice_would_expire(&this_arg_conv, at_time);
57020 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1min_1final_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_arg) {
57021 LDKInvoice this_arg_conv;
57022 this_arg_conv.inner = untag_ptr(this_arg);
57023 this_arg_conv.is_owned = ptr_is_owned(this_arg);
57024 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
57025 this_arg_conv.is_owned = false;
57026 int64_t ret_conv = Invoice_min_final_cltv_expiry_delta(&this_arg_conv);
57030 JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Invoice_1fallback_1addresses(JNIEnv *env, jclass clz, int64_t this_arg) {
57031 LDKInvoice this_arg_conv;
57032 this_arg_conv.inner = untag_ptr(this_arg);
57033 this_arg_conv.is_owned = ptr_is_owned(this_arg);
57034 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
57035 this_arg_conv.is_owned = false;
57036 LDKCVec_AddressZ ret_var = Invoice_fallback_addresses(&this_arg_conv);
57037 jobjectArray ret_arr = NULL;
57038 ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, String_clz, NULL);
57040 jstring *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
57041 for (size_t i = 0; i < ret_var.datalen; i++) {
57042 LDKStr ret_conv_8_str = ret_var.data[i];
57043 jstring ret_conv_8_conv = str_ref_to_java(env, ret_conv_8_str.chars, ret_conv_8_str.len);
57044 Str_free(ret_conv_8_str);
57045 ret_arr_ptr[i] = ret_conv_8_conv;
57047 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
57048 FREE(ret_var.data);
57052 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1private_1routes(JNIEnv *env, jclass clz, int64_t this_arg) {
57053 LDKInvoice this_arg_conv;
57054 this_arg_conv.inner = untag_ptr(this_arg);
57055 this_arg_conv.is_owned = ptr_is_owned(this_arg);
57056 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
57057 this_arg_conv.is_owned = false;
57058 LDKCVec_PrivateRouteZ ret_var = Invoice_private_routes(&this_arg_conv);
57059 int64_tArray ret_arr = NULL;
57060 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
57061 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
57062 for (size_t o = 0; o < ret_var.datalen; o++) {
57063 LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
57064 int64_t ret_conv_14_ref = 0;
57065 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
57066 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
57067 ret_arr_ptr[o] = ret_conv_14_ref;
57069 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
57070 FREE(ret_var.data);
57074 JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Invoice_1route_1hints(JNIEnv *env, jclass clz, int64_t this_arg) {
57075 LDKInvoice this_arg_conv;
57076 this_arg_conv.inner = untag_ptr(this_arg);
57077 this_arg_conv.is_owned = ptr_is_owned(this_arg);
57078 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
57079 this_arg_conv.is_owned = false;
57080 LDKCVec_RouteHintZ ret_var = Invoice_route_hints(&this_arg_conv);
57081 int64_tArray ret_arr = NULL;
57082 ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
57083 int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL);
57084 for (size_t l = 0; l < ret_var.datalen; l++) {
57085 LDKRouteHint ret_conv_11_var = ret_var.data[l];
57086 int64_t ret_conv_11_ref = 0;
57087 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var);
57088 ret_conv_11_ref = tag_ptr(ret_conv_11_var.inner, ret_conv_11_var.is_owned);
57089 ret_arr_ptr[l] = ret_conv_11_ref;
57091 (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0);
57092 FREE(ret_var.data);
57096 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Invoice_1currency(JNIEnv *env, jclass clz, int64_t this_arg) {
57097 LDKInvoice this_arg_conv;
57098 this_arg_conv.inner = untag_ptr(this_arg);
57099 this_arg_conv.is_owned = ptr_is_owned(this_arg);
57100 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
57101 this_arg_conv.is_owned = false;
57102 jclass ret_conv = LDKCurrency_to_java(env, Invoice_currency(&this_arg_conv));
57106 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1amount_1milli_1satoshis(JNIEnv *env, jclass clz, int64_t this_arg) {
57107 LDKInvoice this_arg_conv;
57108 this_arg_conv.inner = untag_ptr(this_arg);
57109 this_arg_conv.is_owned = ptr_is_owned(this_arg);
57110 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
57111 this_arg_conv.is_owned = false;
57112 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
57113 *ret_copy = Invoice_amount_milli_satoshis(&this_arg_conv);
57114 int64_t ret_ref = tag_ptr(ret_copy, true);
57118 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Description_1new(JNIEnv *env, jclass clz, jstring description) {
57119 LDKStr description_conv = java_to_owned_str(env, description);
57120 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
57121 *ret_conv = Description_new(description_conv);
57122 return tag_ptr(ret_conv, true);
57125 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Description_1into_1inner(JNIEnv *env, jclass clz, int64_t this_arg) {
57126 LDKDescription this_arg_conv;
57127 this_arg_conv.inner = untag_ptr(this_arg);
57128 this_arg_conv.is_owned = ptr_is_owned(this_arg);
57129 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
57130 this_arg_conv = Description_clone(&this_arg_conv);
57131 LDKStr ret_str = Description_into_inner(this_arg_conv);
57132 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
57137 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1from_1seconds(JNIEnv *env, jclass clz, int64_t seconds) {
57138 LDKExpiryTime ret_var = ExpiryTime_from_seconds(seconds);
57139 int64_t ret_ref = 0;
57140 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
57141 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
57145 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1from_1duration(JNIEnv *env, jclass clz, int64_t duration) {
57146 LDKExpiryTime ret_var = ExpiryTime_from_duration(duration);
57147 int64_t ret_ref = 0;
57148 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
57149 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
57153 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1as_1seconds(JNIEnv *env, jclass clz, int64_t this_arg) {
57154 LDKExpiryTime this_arg_conv;
57155 this_arg_conv.inner = untag_ptr(this_arg);
57156 this_arg_conv.is_owned = ptr_is_owned(this_arg);
57157 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
57158 this_arg_conv.is_owned = false;
57159 int64_t ret_conv = ExpiryTime_as_seconds(&this_arg_conv);
57163 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ExpiryTime_1as_1duration(JNIEnv *env, jclass clz, int64_t this_arg) {
57164 LDKExpiryTime this_arg_conv;
57165 this_arg_conv.inner = untag_ptr(this_arg);
57166 this_arg_conv.is_owned = ptr_is_owned(this_arg);
57167 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
57168 this_arg_conv.is_owned = false;
57169 int64_t ret_conv = ExpiryTime_as_duration(&this_arg_conv);
57173 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1new(JNIEnv *env, jclass clz, int64_t hops) {
57174 LDKRouteHint hops_conv;
57175 hops_conv.inner = untag_ptr(hops);
57176 hops_conv.is_owned = ptr_is_owned(hops);
57177 CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv);
57178 hops_conv = RouteHint_clone(&hops_conv);
57179 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
57180 *ret_conv = PrivateRoute_new(hops_conv);
57181 return tag_ptr(ret_conv, true);
57184 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1into_1inner(JNIEnv *env, jclass clz, int64_t this_arg) {
57185 LDKPrivateRoute this_arg_conv;
57186 this_arg_conv.inner = untag_ptr(this_arg);
57187 this_arg_conv.is_owned = ptr_is_owned(this_arg);
57188 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
57189 this_arg_conv = PrivateRoute_clone(&this_arg_conv);
57190 LDKRouteHint ret_var = PrivateRoute_into_inner(this_arg_conv);
57191 int64_t ret_ref = 0;
57192 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
57193 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
57197 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
57198 LDKCreationError* orig_conv = (LDKCreationError*)untag_ptr(orig);
57199 jclass ret_conv = LDKCreationError_to_java(env, CreationError_clone(orig_conv));
57203 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1description_1too_1long(JNIEnv *env, jclass clz) {
57204 jclass ret_conv = LDKCreationError_to_java(env, CreationError_description_too_long());
57208 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1route_1too_1long(JNIEnv *env, jclass clz) {
57209 jclass ret_conv = LDKCreationError_to_java(env, CreationError_route_too_long());
57213 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1timestamp_1out_1of_1bounds(JNIEnv *env, jclass clz) {
57214 jclass ret_conv = LDKCreationError_to_java(env, CreationError_timestamp_out_of_bounds());
57218 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1invalid_1amount(JNIEnv *env, jclass clz) {
57219 jclass ret_conv = LDKCreationError_to_java(env, CreationError_invalid_amount());
57223 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1missing_1route_1hints(JNIEnv *env, jclass clz) {
57224 jclass ret_conv = LDKCreationError_to_java(env, CreationError_missing_route_hints());
57228 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1min_1final_1cltv_1expiry_1delta_1too_1short(JNIEnv *env, jclass clz) {
57229 jclass ret_conv = LDKCreationError_to_java(env, CreationError_min_final_cltv_expiry_delta_too_short());
57233 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CreationError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
57234 LDKCreationError* a_conv = (LDKCreationError*)untag_ptr(a);
57235 LDKCreationError* b_conv = (LDKCreationError*)untag_ptr(b);
57236 jboolean ret_conv = CreationError_eq(a_conv, b_conv);
57240 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CreationError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
57241 LDKCreationError* o_conv = (LDKCreationError*)untag_ptr(o);
57242 LDKStr ret_str = CreationError_to_str(o_conv);
57243 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
57248 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
57249 LDKSemanticError* orig_conv = (LDKSemanticError*)untag_ptr(orig);
57250 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_clone(orig_conv));
57254 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1no_1payment_1hash(JNIEnv *env, jclass clz) {
57255 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_no_payment_hash());
57259 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1payment_1hashes(JNIEnv *env, jclass clz) {
57260 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_multiple_payment_hashes());
57264 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1no_1description(JNIEnv *env, jclass clz) {
57265 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_no_description());
57269 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1descriptions(JNIEnv *env, jclass clz) {
57270 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_multiple_descriptions());
57274 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1no_1payment_1secret(JNIEnv *env, jclass clz) {
57275 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_no_payment_secret());
57279 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1payment_1secrets(JNIEnv *env, jclass clz) {
57280 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_multiple_payment_secrets());
57284 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1features(JNIEnv *env, jclass clz) {
57285 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_invalid_features());
57289 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1recovery_1id(JNIEnv *env, jclass clz) {
57290 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_invalid_recovery_id());
57294 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1signature(JNIEnv *env, jclass clz) {
57295 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_invalid_signature());
57299 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1imprecise_1amount(JNIEnv *env, jclass clz) {
57300 jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_imprecise_amount());
57304 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SemanticError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
57305 LDKSemanticError* a_conv = (LDKSemanticError*)untag_ptr(a);
57306 LDKSemanticError* b_conv = (LDKSemanticError*)untag_ptr(b);
57307 jboolean ret_conv = SemanticError_eq(a_conv, b_conv);
57311 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SemanticError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
57312 LDKSemanticError* o_conv = (LDKSemanticError*)untag_ptr(o);
57313 LDKStr ret_str = SemanticError_to_str(o_conv);
57314 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
57319 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
57320 if (!ptr_is_owned(this_ptr)) return;
57321 void* this_ptr_ptr = untag_ptr(this_ptr);
57322 CHECK_ACCESS(this_ptr_ptr);
57323 LDKSignOrCreationError this_ptr_conv = *(LDKSignOrCreationError*)(this_ptr_ptr);
57324 FREE(untag_ptr(this_ptr));
57325 SignOrCreationError_free(this_ptr_conv);
57328 static inline uint64_t SignOrCreationError_clone_ptr(LDKSignOrCreationError *NONNULL_PTR arg) {
57329 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
57330 *ret_copy = SignOrCreationError_clone(arg);
57331 int64_t ret_ref = tag_ptr(ret_copy, true);
57334 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
57335 LDKSignOrCreationError* arg_conv = (LDKSignOrCreationError*)untag_ptr(arg);
57336 int64_t ret_conv = SignOrCreationError_clone_ptr(arg_conv);
57340 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
57341 LDKSignOrCreationError* orig_conv = (LDKSignOrCreationError*)untag_ptr(orig);
57342 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
57343 *ret_copy = SignOrCreationError_clone(orig_conv);
57344 int64_t ret_ref = tag_ptr(ret_copy, true);
57348 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1sign_1error(JNIEnv *env, jclass clz) {
57349 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
57350 *ret_copy = SignOrCreationError_sign_error();
57351 int64_t ret_ref = tag_ptr(ret_copy, true);
57355 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1creation_1error(JNIEnv *env, jclass clz, jclass a) {
57356 LDKCreationError a_conv = LDKCreationError_from_java(env, a);
57357 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
57358 *ret_copy = SignOrCreationError_creation_error(a_conv);
57359 int64_t ret_ref = tag_ptr(ret_copy, true);
57363 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
57364 LDKSignOrCreationError* a_conv = (LDKSignOrCreationError*)untag_ptr(a);
57365 LDKSignOrCreationError* b_conv = (LDKSignOrCreationError*)untag_ptr(b);
57366 jboolean ret_conv = SignOrCreationError_eq(a_conv, b_conv);
57370 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
57371 LDKSignOrCreationError* o_conv = (LDKSignOrCreationError*)untag_ptr(o);
57372 LDKStr ret_str = SignOrCreationError_to_str(o_conv);
57373 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
57378 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) {
57379 LDKInvoice invoice_conv;
57380 invoice_conv.inner = untag_ptr(invoice);
57381 invoice_conv.is_owned = ptr_is_owned(invoice);
57382 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
57383 invoice_conv.is_owned = false;
57384 void* retry_strategy_ptr = untag_ptr(retry_strategy);
57385 CHECK_ACCESS(retry_strategy_ptr);
57386 LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr);
57387 retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy));
57388 LDKChannelManager channelmanager_conv;
57389 channelmanager_conv.inner = untag_ptr(channelmanager);
57390 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
57391 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
57392 channelmanager_conv.is_owned = false;
57393 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
57394 *ret_conv = pay_invoice(&invoice_conv, retry_strategy_conv, &channelmanager_conv);
57395 return tag_ptr(ret_conv, true);
57398 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) {
57399 LDKInvoice invoice_conv;
57400 invoice_conv.inner = untag_ptr(invoice);
57401 invoice_conv.is_owned = ptr_is_owned(invoice);
57402 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
57403 invoice_conv.is_owned = false;
57404 LDKThirtyTwoBytes payment_id_ref;
57405 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
57406 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
57407 void* retry_strategy_ptr = untag_ptr(retry_strategy);
57408 CHECK_ACCESS(retry_strategy_ptr);
57409 LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr);
57410 retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy));
57411 LDKChannelManager channelmanager_conv;
57412 channelmanager_conv.inner = untag_ptr(channelmanager);
57413 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
57414 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
57415 channelmanager_conv.is_owned = false;
57416 LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ");
57417 *ret_conv = pay_invoice_with_id(&invoice_conv, payment_id_ref, retry_strategy_conv, &channelmanager_conv);
57418 return tag_ptr(ret_conv, true);
57421 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) {
57422 LDKInvoice invoice_conv;
57423 invoice_conv.inner = untag_ptr(invoice);
57424 invoice_conv.is_owned = ptr_is_owned(invoice);
57425 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
57426 invoice_conv.is_owned = false;
57427 void* retry_strategy_ptr = untag_ptr(retry_strategy);
57428 CHECK_ACCESS(retry_strategy_ptr);
57429 LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr);
57430 retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy));
57431 LDKChannelManager channelmanager_conv;
57432 channelmanager_conv.inner = untag_ptr(channelmanager);
57433 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
57434 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
57435 channelmanager_conv.is_owned = false;
57436 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
57437 *ret_conv = pay_zero_value_invoice(&invoice_conv, amount_msats, retry_strategy_conv, &channelmanager_conv);
57438 return tag_ptr(ret_conv, true);
57441 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) {
57442 LDKInvoice invoice_conv;
57443 invoice_conv.inner = untag_ptr(invoice);
57444 invoice_conv.is_owned = ptr_is_owned(invoice);
57445 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
57446 invoice_conv.is_owned = false;
57447 LDKThirtyTwoBytes payment_id_ref;
57448 CHECK((*env)->GetArrayLength(env, payment_id) == 32);
57449 (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data);
57450 void* retry_strategy_ptr = untag_ptr(retry_strategy);
57451 CHECK_ACCESS(retry_strategy_ptr);
57452 LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr);
57453 retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy));
57454 LDKChannelManager channelmanager_conv;
57455 channelmanager_conv.inner = untag_ptr(channelmanager);
57456 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
57457 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
57458 channelmanager_conv.is_owned = false;
57459 LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ");
57460 *ret_conv = pay_zero_value_invoice_with_id(&invoice_conv, amount_msats, payment_id_ref, retry_strategy_conv, &channelmanager_conv);
57461 return tag_ptr(ret_conv, true);
57464 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
57465 if (!ptr_is_owned(this_ptr)) return;
57466 void* this_ptr_ptr = untag_ptr(this_ptr);
57467 CHECK_ACCESS(this_ptr_ptr);
57468 LDKPaymentError this_ptr_conv = *(LDKPaymentError*)(this_ptr_ptr);
57469 FREE(untag_ptr(this_ptr));
57470 PaymentError_free(this_ptr_conv);
57473 static inline uint64_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg) {
57474 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
57475 *ret_copy = PaymentError_clone(arg);
57476 int64_t ret_ref = tag_ptr(ret_copy, true);
57479 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
57480 LDKPaymentError* arg_conv = (LDKPaymentError*)untag_ptr(arg);
57481 int64_t ret_conv = PaymentError_clone_ptr(arg_conv);
57485 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
57486 LDKPaymentError* orig_conv = (LDKPaymentError*)untag_ptr(orig);
57487 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
57488 *ret_copy = PaymentError_clone(orig_conv);
57489 int64_t ret_ref = tag_ptr(ret_copy, true);
57493 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1invoice(JNIEnv *env, jclass clz, jstring a) {
57494 LDKStr a_conv = java_to_owned_str(env, a);
57495 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
57496 *ret_copy = PaymentError_invoice(a_conv);
57497 int64_t ret_ref = tag_ptr(ret_copy, true);
57501 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentError_1sending(JNIEnv *env, jclass clz, jclass a) {
57502 LDKRetryableSendFailure a_conv = LDKRetryableSendFailure_from_java(env, a);
57503 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
57504 *ret_copy = PaymentError_sending(a_conv);
57505 int64_t ret_ref = tag_ptr(ret_copy, true);
57509 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) {
57510 void* amt_msat_ptr = untag_ptr(amt_msat);
57511 CHECK_ACCESS(amt_msat_ptr);
57512 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
57513 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
57514 LDKThirtyTwoBytes payment_hash_ref;
57515 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
57516 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
57517 LDKStr description_conv = java_to_owned_str(env, description);
57518 LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr;
57519 phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints);
57520 if (phantom_route_hints_constr.datalen > 0)
57521 phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements");
57523 phantom_route_hints_constr.data = NULL;
57524 int64_t* phantom_route_hints_vals = (*env)->GetLongArrayElements (env, phantom_route_hints, NULL);
57525 for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) {
57526 int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t];
57527 LDKPhantomRouteHints phantom_route_hints_conv_19_conv;
57528 phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19);
57529 phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19);
57530 CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv);
57531 phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv);
57532 phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv;
57534 (*env)->ReleaseLongArrayElements(env, phantom_route_hints, phantom_route_hints_vals, 0);
57535 void* entropy_source_ptr = untag_ptr(entropy_source);
57536 CHECK_ACCESS(entropy_source_ptr);
57537 LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr);
57538 if (entropy_source_conv.free == LDKEntropySource_JCalls_free) {
57539 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
57540 LDKEntropySource_JCalls_cloned(&entropy_source_conv);
57542 void* node_signer_ptr = untag_ptr(node_signer);
57543 CHECK_ACCESS(node_signer_ptr);
57544 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
57545 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
57546 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
57547 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
57549 void* logger_ptr = untag_ptr(logger);
57550 CHECK_ACCESS(logger_ptr);
57551 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
57552 if (logger_conv.free == LDKLogger_JCalls_free) {
57553 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
57554 LDKLogger_JCalls_cloned(&logger_conv);
57556 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
57557 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
57558 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
57559 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
57560 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
57561 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
57562 *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);
57563 return tag_ptr(ret_conv, true);
57566 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) {
57567 void* amt_msat_ptr = untag_ptr(amt_msat);
57568 CHECK_ACCESS(amt_msat_ptr);
57569 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
57570 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
57571 LDKThirtyTwoBytes payment_hash_ref;
57572 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
57573 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
57574 LDKSha256 description_hash_conv;
57575 description_hash_conv.inner = untag_ptr(description_hash);
57576 description_hash_conv.is_owned = ptr_is_owned(description_hash);
57577 CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
57578 description_hash_conv = Sha256_clone(&description_hash_conv);
57579 LDKCVec_PhantomRouteHintsZ phantom_route_hints_constr;
57580 phantom_route_hints_constr.datalen = (*env)->GetArrayLength(env, phantom_route_hints);
57581 if (phantom_route_hints_constr.datalen > 0)
57582 phantom_route_hints_constr.data = MALLOC(phantom_route_hints_constr.datalen * sizeof(LDKPhantomRouteHints), "LDKCVec_PhantomRouteHintsZ Elements");
57584 phantom_route_hints_constr.data = NULL;
57585 int64_t* phantom_route_hints_vals = (*env)->GetLongArrayElements (env, phantom_route_hints, NULL);
57586 for (size_t t = 0; t < phantom_route_hints_constr.datalen; t++) {
57587 int64_t phantom_route_hints_conv_19 = phantom_route_hints_vals[t];
57588 LDKPhantomRouteHints phantom_route_hints_conv_19_conv;
57589 phantom_route_hints_conv_19_conv.inner = untag_ptr(phantom_route_hints_conv_19);
57590 phantom_route_hints_conv_19_conv.is_owned = ptr_is_owned(phantom_route_hints_conv_19);
57591 CHECK_INNER_FIELD_ACCESS_OR_NULL(phantom_route_hints_conv_19_conv);
57592 phantom_route_hints_conv_19_conv = PhantomRouteHints_clone(&phantom_route_hints_conv_19_conv);
57593 phantom_route_hints_constr.data[t] = phantom_route_hints_conv_19_conv;
57595 (*env)->ReleaseLongArrayElements(env, phantom_route_hints, phantom_route_hints_vals, 0);
57596 void* entropy_source_ptr = untag_ptr(entropy_source);
57597 CHECK_ACCESS(entropy_source_ptr);
57598 LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr);
57599 if (entropy_source_conv.free == LDKEntropySource_JCalls_free) {
57600 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
57601 LDKEntropySource_JCalls_cloned(&entropy_source_conv);
57603 void* node_signer_ptr = untag_ptr(node_signer);
57604 CHECK_ACCESS(node_signer_ptr);
57605 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
57606 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
57607 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
57608 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
57610 void* logger_ptr = untag_ptr(logger);
57611 CHECK_ACCESS(logger_ptr);
57612 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
57613 if (logger_conv.free == LDKLogger_JCalls_free) {
57614 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
57615 LDKLogger_JCalls_cloned(&logger_conv);
57617 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
57618 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
57619 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
57620 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
57621 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
57622 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
57623 *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);
57624 return tag_ptr(ret_conv, true);
57627 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) {
57628 LDKChannelManager channelmanager_conv;
57629 channelmanager_conv.inner = untag_ptr(channelmanager);
57630 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
57631 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
57632 channelmanager_conv.is_owned = false;
57633 void* node_signer_ptr = untag_ptr(node_signer);
57634 CHECK_ACCESS(node_signer_ptr);
57635 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
57636 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
57637 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
57638 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
57640 void* logger_ptr = untag_ptr(logger);
57641 CHECK_ACCESS(logger_ptr);
57642 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
57643 if (logger_conv.free == LDKLogger_JCalls_free) {
57644 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
57645 LDKLogger_JCalls_cloned(&logger_conv);
57647 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
57648 void* amt_msat_ptr = untag_ptr(amt_msat);
57649 CHECK_ACCESS(amt_msat_ptr);
57650 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
57651 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
57652 LDKStr description_conv = java_to_owned_str(env, description);
57653 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
57654 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
57655 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
57656 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
57657 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
57658 *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);
57659 return tag_ptr(ret_conv, true);
57662 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) {
57663 LDKChannelManager channelmanager_conv;
57664 channelmanager_conv.inner = untag_ptr(channelmanager);
57665 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
57666 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
57667 channelmanager_conv.is_owned = false;
57668 void* node_signer_ptr = untag_ptr(node_signer);
57669 CHECK_ACCESS(node_signer_ptr);
57670 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
57671 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
57672 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
57673 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
57675 void* logger_ptr = untag_ptr(logger);
57676 CHECK_ACCESS(logger_ptr);
57677 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
57678 if (logger_conv.free == LDKLogger_JCalls_free) {
57679 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
57680 LDKLogger_JCalls_cloned(&logger_conv);
57682 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
57683 void* amt_msat_ptr = untag_ptr(amt_msat);
57684 CHECK_ACCESS(amt_msat_ptr);
57685 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
57686 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
57687 LDKSha256 description_hash_conv;
57688 description_hash_conv.inner = untag_ptr(description_hash);
57689 description_hash_conv.is_owned = ptr_is_owned(description_hash);
57690 CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
57691 description_hash_conv = Sha256_clone(&description_hash_conv);
57692 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
57693 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
57694 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
57695 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
57696 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
57697 *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);
57698 return tag_ptr(ret_conv, true);
57701 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) {
57702 LDKChannelManager channelmanager_conv;
57703 channelmanager_conv.inner = untag_ptr(channelmanager);
57704 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
57705 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
57706 channelmanager_conv.is_owned = false;
57707 void* node_signer_ptr = untag_ptr(node_signer);
57708 CHECK_ACCESS(node_signer_ptr);
57709 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
57710 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
57711 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
57712 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
57714 void* logger_ptr = untag_ptr(logger);
57715 CHECK_ACCESS(logger_ptr);
57716 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
57717 if (logger_conv.free == LDKLogger_JCalls_free) {
57718 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
57719 LDKLogger_JCalls_cloned(&logger_conv);
57721 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
57722 void* amt_msat_ptr = untag_ptr(amt_msat);
57723 CHECK_ACCESS(amt_msat_ptr);
57724 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
57725 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
57726 LDKSha256 description_hash_conv;
57727 description_hash_conv.inner = untag_ptr(description_hash);
57728 description_hash_conv.is_owned = ptr_is_owned(description_hash);
57729 CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
57730 description_hash_conv = Sha256_clone(&description_hash_conv);
57731 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
57732 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
57733 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
57734 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
57735 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
57736 *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);
57737 return tag_ptr(ret_conv, true);
57740 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) {
57741 LDKChannelManager channelmanager_conv;
57742 channelmanager_conv.inner = untag_ptr(channelmanager);
57743 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
57744 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
57745 channelmanager_conv.is_owned = false;
57746 void* node_signer_ptr = untag_ptr(node_signer);
57747 CHECK_ACCESS(node_signer_ptr);
57748 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
57749 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
57750 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
57751 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
57753 void* logger_ptr = untag_ptr(logger);
57754 CHECK_ACCESS(logger_ptr);
57755 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
57756 if (logger_conv.free == LDKLogger_JCalls_free) {
57757 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
57758 LDKLogger_JCalls_cloned(&logger_conv);
57760 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
57761 void* amt_msat_ptr = untag_ptr(amt_msat);
57762 CHECK_ACCESS(amt_msat_ptr);
57763 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
57764 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
57765 LDKStr description_conv = java_to_owned_str(env, description);
57766 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
57767 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
57768 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
57769 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
57770 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
57771 *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);
57772 return tag_ptr(ret_conv, true);
57775 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) {
57776 LDKChannelManager channelmanager_conv;
57777 channelmanager_conv.inner = untag_ptr(channelmanager);
57778 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
57779 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
57780 channelmanager_conv.is_owned = false;
57781 void* node_signer_ptr = untag_ptr(node_signer);
57782 CHECK_ACCESS(node_signer_ptr);
57783 LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr);
57784 if (node_signer_conv.free == LDKNodeSigner_JCalls_free) {
57785 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
57786 LDKNodeSigner_JCalls_cloned(&node_signer_conv);
57788 void* logger_ptr = untag_ptr(logger);
57789 CHECK_ACCESS(logger_ptr);
57790 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
57791 if (logger_conv.free == LDKLogger_JCalls_free) {
57792 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
57793 LDKLogger_JCalls_cloned(&logger_conv);
57795 LDKCurrency network_conv = LDKCurrency_from_java(env, network);
57796 void* amt_msat_ptr = untag_ptr(amt_msat);
57797 CHECK_ACCESS(amt_msat_ptr);
57798 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
57799 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
57800 LDKStr description_conv = java_to_owned_str(env, description);
57801 LDKThirtyTwoBytes payment_hash_ref;
57802 CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
57803 (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
57804 void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta);
57805 CHECK_ACCESS(min_final_cltv_expiry_delta_ptr);
57806 LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr);
57807 min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta));
57808 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
57809 *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);
57810 return tag_ptr(ret_conv, true);
57813 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SiPrefix_1from_1str(JNIEnv *env, jclass clz, jstring s) {
57814 LDKStr s_conv = java_to_owned_str(env, s);
57815 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
57816 *ret_conv = SiPrefix_from_str(s_conv);
57817 return tag_ptr(ret_conv, true);
57820 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Invoice_1from_1str(JNIEnv *env, jclass clz, jstring s) {
57821 LDKStr s_conv = java_to_owned_str(env, s);
57822 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
57823 *ret_conv = Invoice_from_str(s_conv);
57824 return tag_ptr(ret_conv, true);
57827 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1from_1str(JNIEnv *env, jclass clz, jstring s) {
57828 LDKStr s_conv = java_to_owned_str(env, s);
57829 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
57830 *ret_conv = SignedRawInvoice_from_str(s_conv);
57831 return tag_ptr(ret_conv, true);
57834 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ParseError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
57835 LDKParseError* o_conv = (LDKParseError*)untag_ptr(o);
57836 LDKStr ret_str = ParseError_to_str(o_conv);
57837 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
57842 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
57843 LDKParseOrSemanticError* o_conv = (LDKParseOrSemanticError*)untag_ptr(o);
57844 LDKStr ret_str = ParseOrSemanticError_to_str(o_conv);
57845 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
57850 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Invoice_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
57852 o_conv.inner = untag_ptr(o);
57853 o_conv.is_owned = ptr_is_owned(o);
57854 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
57855 o_conv.is_owned = false;
57856 LDKStr ret_str = Invoice_to_str(&o_conv);
57857 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
57862 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
57863 LDKSignedRawInvoice o_conv;
57864 o_conv.inner = untag_ptr(o);
57865 o_conv.is_owned = ptr_is_owned(o);
57866 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
57867 o_conv.is_owned = false;
57868 LDKStr ret_str = SignedRawInvoice_to_str(&o_conv);
57869 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
57874 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Currency_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
57875 LDKCurrency* o_conv = (LDKCurrency*)untag_ptr(o);
57876 LDKStr ret_str = Currency_to_str(o_conv);
57877 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
57882 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SiPrefix_1to_1str(JNIEnv *env, jclass clz, int64_t o) {
57883 LDKSiPrefix* o_conv = (LDKSiPrefix*)untag_ptr(o);
57884 LDKStr ret_str = SiPrefix_to_str(o_conv);
57885 jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
57890 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
57891 LDKRapidGossipSync this_obj_conv;
57892 this_obj_conv.inner = untag_ptr(this_obj);
57893 this_obj_conv.is_owned = ptr_is_owned(this_obj);
57894 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
57895 RapidGossipSync_free(this_obj_conv);
57898 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t logger) {
57899 LDKNetworkGraph network_graph_conv;
57900 network_graph_conv.inner = untag_ptr(network_graph);
57901 network_graph_conv.is_owned = ptr_is_owned(network_graph);
57902 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
57903 network_graph_conv.is_owned = false;
57904 void* logger_ptr = untag_ptr(logger);
57905 CHECK_ACCESS(logger_ptr);
57906 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
57907 if (logger_conv.free == LDKLogger_JCalls_free) {
57908 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
57909 LDKLogger_JCalls_cloned(&logger_conv);
57911 LDKRapidGossipSync ret_var = RapidGossipSync_new(&network_graph_conv, logger_conv);
57912 int64_t ret_ref = 0;
57913 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
57914 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
57918 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) {
57919 LDKRapidGossipSync this_arg_conv;
57920 this_arg_conv.inner = untag_ptr(this_arg);
57921 this_arg_conv.is_owned = ptr_is_owned(this_arg);
57922 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
57923 this_arg_conv.is_owned = false;
57924 LDKu8slice update_data_ref;
57925 update_data_ref.datalen = (*env)->GetArrayLength(env, update_data);
57926 update_data_ref.data = (*env)->GetByteArrayElements (env, update_data, NULL);
57927 void* current_time_unix_ptr = untag_ptr(current_time_unix);
57928 CHECK_ACCESS(current_time_unix_ptr);
57929 LDKCOption_u64Z current_time_unix_conv = *(LDKCOption_u64Z*)(current_time_unix_ptr);
57930 current_time_unix_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(current_time_unix));
57931 LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
57932 *ret_conv = RapidGossipSync_update_network_graph_no_std(&this_arg_conv, update_data_ref, current_time_unix_conv);
57933 (*env)->ReleaseByteArrayElements(env, update_data, (int8_t*)update_data_ref.data, 0);
57934 return tag_ptr(ret_conv, true);
57937 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1is_1initial_1sync_1complete(JNIEnv *env, jclass clz, int64_t this_arg) {
57938 LDKRapidGossipSync this_arg_conv;
57939 this_arg_conv.inner = untag_ptr(this_arg);
57940 this_arg_conv.is_owned = ptr_is_owned(this_arg);
57941 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
57942 this_arg_conv.is_owned = false;
57943 jboolean ret_conv = RapidGossipSync_is_initial_sync_complete(&this_arg_conv);
57947 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
57948 if (!ptr_is_owned(this_ptr)) return;
57949 void* this_ptr_ptr = untag_ptr(this_ptr);
57950 CHECK_ACCESS(this_ptr_ptr);
57951 LDKGraphSyncError this_ptr_conv = *(LDKGraphSyncError*)(this_ptr_ptr);
57952 FREE(untag_ptr(this_ptr));
57953 GraphSyncError_free(this_ptr_conv);
57956 static inline uint64_t GraphSyncError_clone_ptr(LDKGraphSyncError *NONNULL_PTR arg) {
57957 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
57958 *ret_copy = GraphSyncError_clone(arg);
57959 int64_t ret_ref = tag_ptr(ret_copy, true);
57962 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
57963 LDKGraphSyncError* arg_conv = (LDKGraphSyncError*)untag_ptr(arg);
57964 int64_t ret_conv = GraphSyncError_clone_ptr(arg_conv);
57968 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
57969 LDKGraphSyncError* orig_conv = (LDKGraphSyncError*)untag_ptr(orig);
57970 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
57971 *ret_copy = GraphSyncError_clone(orig_conv);
57972 int64_t ret_ref = tag_ptr(ret_copy, true);
57976 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1decode_1error(JNIEnv *env, jclass clz, int64_t a) {
57977 void* a_ptr = untag_ptr(a);
57978 CHECK_ACCESS(a_ptr);
57979 LDKDecodeError a_conv = *(LDKDecodeError*)(a_ptr);
57980 a_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(a));
57981 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
57982 *ret_copy = GraphSyncError_decode_error(a_conv);
57983 int64_t ret_ref = tag_ptr(ret_copy, true);
57987 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1lightning_1error(JNIEnv *env, jclass clz, int64_t a) {
57988 LDKLightningError a_conv;
57989 a_conv.inner = untag_ptr(a);
57990 a_conv.is_owned = ptr_is_owned(a);
57991 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
57992 a_conv = LightningError_clone(&a_conv);
57993 LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
57994 *ret_copy = GraphSyncError_lightning_error(a_conv);
57995 int64_t ret_ref = tag_ptr(ret_copy, true);